Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2753

struts-el html tag library errorKey not using documented default value on Oracle Application Server

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.7
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: All
    • Bugzilla Id:
      38461

      Description

      I encountered an odd problem with the struts-el html tag library.

      I was using code like the following in my jsp to render any entry boxes that
      weren't valid in a a different style.
      <html:text errorStyleClass="error" property="lastname" />

      This was working fine when I was using the struts html tag library but when I
      started using the html-el tag library the errorStyleClass was no longer being
      used when running the application on Oracle Application Server. However it still
      worked fine under tomcat 5.5

      After debugging this problem I found out that it was being set to null by the
      release() method in ELTextTag where there are the lines
      setDisabledExpr(null);
      setErrorKey(null);
      setErrorStyleExpr(null);

      I think the middle line should be setErrorKeyExpr(null) as ErrorKey is already
      set to Global.ERROR_KEY by the call to super.release() and ErrorKeyExpr is not
      reset anywhere in the release method. When running on tomcat the release method
      never seemed to get called leaving the error key set to the expected value.

      I've worked around this for the moment by explicitly specifying the value for
      ErrorKey as below
      <html:text errorKey="org.apache.struts.action.ERROR" errorStyleClass="error"
      property="lastname" />

      Note: The following classes all exhibit the same problem.
      ELCheckboxTag.java
      ELFileTag.java
      ELMultiboxTag.java
      ELPasswordTag.java
      ELRadioTag.java
      ELSelectTag.java
      ELTextareaTag.java
      ELTextTag.java

      I've checked in the 1.2.8 release and the source code repository and the same
      issue appears to be present in those as well.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              michael@technomyth.co.uk Michael Manley
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: