Trouble passing non-string values to custom tag attributes.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Adam_Stokar
Posted On:   Friday, March 14, 2008 01:54 AM

I have a bizarre problem. On my Windows machine, I am running Tomcat6, on Linux, Tomcat 5.5. My custom tags work fine on version 6, however I am getting the following error with the exact same file on Tomcat 5.5 Unable to convert string "${USER.memberSince}" to class "java.util.Date" for attribute "date": Property Editor not registered with the PropertyEditorManager My JSP contains the following tag memberSince is of type Date in my User class. The JSP is treating the value as a String rather than the Date type and I can't figure out why. I am having the same problem with other tags that have a type other than String. Do I not have the right .jar files i   More>>

I have a bizarre problem. On my Windows machine, I am running Tomcat6, on Linux, Tomcat 5.5. My custom tags work fine on version 6, however I am getting the following error with the exact same file on Tomcat 5.5

			
Unable to convert string "${USER.memberSince}" to class "java.util.Date" for attribute "date": Property Editor not registered with the PropertyEditorManager


My JSP contains the following tag
			



memberSince is of type Date in my User class. The JSP is treating the value as a String rather than the Date type and I can't figure out why. I am having the same problem with other tags that have a type other than String. Do I not have the right .jar files in my lib? Is there any reason this would be working in Tomcat6 on Windows but not in Tomcat5.5 on Linux?

Any help is appreciated.    <<Less

Re: Trouble passing non-string values to custom tag attributes.

Posted By:   Christopher_Koenigsberg  
Posted On:   Friday, March 14, 2008 11:30 AM

just a guess, but that may have something to do with the "EL" Expression Language part of the JSTL (that's when you put an expression inside the "${}", instead of the old "jsp expression" syntax where you'd have to explicitly invoke the getter on the bean or variable )......



I think with JSTL v1.X (?) the "EL" expression evaluation is done by the client, not the container? (so the whole expression is seen, unevaluated, by the client, which has to recognize it and pass it to its own evaluator) but with JSTL 2.X it is moved/absorbed/incorporated, so it done by the container, and the client only gets to see the finished evaluated result?



so maybe, just maybe, on Tomcat 6 your EL expression is evaluated by the container itself; but on Tomcat 5 it is evaluated by an API in a jar file, which maybe has something missing, or a configuration problem, etc.? (how to "register" the Property Editor??)
About | Sitemap | Contact