Affects Version/s: 1.2.7
Fix Version/s: None
Component/s: Tag Libraries EL (Dormant)
Environment:Operating System: All
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
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"
Note: The following classes all exhibit the same problem.
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.