Bug 11269

Summary: sql:dateParam does not accept Date as a parameter
Product: Taglibs Reporter: Prasad Subramanian <prasad.subramanian>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P3    
Version: 1.0   
Target Milestone: ---   
Hardware: Other   
OS: other   
Attachments: Listing of the servlet that is generated by the JSP that threw this error

Description Prasad Subramanian 2002-07-30 01:54:29 UTC
Lets say that we have a sql:sqlDateParam tag that looks like this :
<sql:sqlDateParam value="${frdt}" type="date" />

where frdt is an object exported by fmt:parseDate

The following error is thrown :
========================================================================
org.apache.jasper.JasperException: An error occurred while evaluating custom 
action attribute "value" with value "Mon Jan 01 00:01:00 PST 2001": Attempt to 
convert String "Mon Jan 01 00:01:00 PST 2001" to type "java.util.Date", but 
there is no PropertyEditor for that type
	at org.apache.jasper.servlet.JspServletWrapper.service
(JspServletWrapper.java:246)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:289)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:247)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:260)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:191)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke
(AuthenticatorBase.java:471)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardContext.invoke
(StandardContext.java:2350)
	at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:180)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:171)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:174)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.coyote.tomcat4.CoyoteAdapter.service
(CoyoteAdapter.java:223)
	at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:405)
	at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnectio
n(Http11Protocol.java:380)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:508)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
(ThreadPool.java:533)
	at java.lang.Thread.run(Thread.java:536)


root cause 

javax.servlet.ServletException: An error occurred while evaluating custom 
action attribute "value" with value "Mon Jan 01 00:01:00 PST 2001": Attempt to 
convert String "Mon Jan 01 00:01:00 PST 2001" to type "java.util.Date", but 
there is no PropertyEditor for that type
	at org.apache.jasper.runtime.PageContextImpl.handlePageException
(PageContextImpl.java:573)
	at 
org.apache.jsp.status_0005freview_0005fperson_0005fi18n$jsp._jspService
(status_0005freview_0005fperson_0005fi18n$jsp.java:353)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.jasper.servlet.JspServletWrapper.service
(JspServletWrapper.java:202)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:289)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:247)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:260)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:191)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke
(AuthenticatorBase.java:471)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardContext.invoke
(StandardContext.java:2350)
	at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:180)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:171)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:174)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.coyote.tomcat4.CoyoteAdapter.service
(CoyoteAdapter.java:223)
	at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:405)
	at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnectio
n(Http11Protocol.java:380)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:508)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
(ThreadPool.java:533)
	at java.lang.Thread.run(Thread.java:536)



--------------------------------------------------------------------------------

J2EE SDK/1.4

==============================================================================
Comment 1 Prasad Subramanian 2002-07-30 01:56:49 UTC
Created attachment 2521 [details]
Listing of the servlet that is generated by the JSP that threw this error
Comment 2 Shawn Bayern 2002-07-30 02:08:59 UTC
You are apparently using the JSR-152 RI prototype with the "EL" version of the 
JSTL 1.0 classes.  This is not possible; the error is that the 'value' 
parameter for the date tag has type String because it expects a String 
expression, so when the EL code in Jasper2 itself looks at the attribute, it 
sees a type of Date, not String.  If you use a regular version of Tomcat 4.0.4, 
or if you use the "RT" version of the JSTL tags with the container you're 
using, the problem should go away.
Comment 3 Prasad Subramanian 2002-07-30 04:32:09 UTC
OK,
So that means we canot use JSTL tags with the new Tomcat container until the EL
packaging is resolved.
Since I have jsp20el.jar also in there along with the standard.jar in the
WEB-INF/lib  of the webapp.
Comments ?
Comment 4 Shawn Bayern 2002-07-30 12:52:36 UTC
1) It's not just jsp20el.jar; it's also the built-in container support for 
using calling the EL from the page-implementation class.

2) You can use JSTL, but you must use the "RI" libraries, not the "EL" ones.
Comment 5 Shawn Bayern 2002-07-30 12:59:59 UTC
(Make that __"RT"__ instead of "EL")