The moose likes JSP and the fly likes jsp:setProperty with java.util.Date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp:setProperty with java.util.Date" Watch "jsp:setProperty with java.util.Date" New topic

jsp:setProperty with java.util.Date

Arturo Frapp�

Joined: Feb 28, 2006
Posts: 1
I'm just trying to set a pojo with several Date fields.

At JSP side:

<jsp:useBean id="work" class="mx.colmex.pub.Work" scope="request">
<jsp:setProperty name="work" property="*" />

From the form I write: 01/12/2006 (December 1st. 2006)

Then when I submit the form I get:
org.apache.jasper.JasperException: jsp.error.beans.property.conversionorg.apache.jasper.runtime.JspRuntimeLibrary.internalIntrospecthelper(JspRuntimeLibrary.java:359)org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(JspRuntimeLibrary.java:306)org.apache.jasper.runtime.JspRuntimeLibrary.introspect(JspRuntimeLibrary.java:284)
Christophe Verré

Joined: Nov 24, 2005
Posts: 14687

I think that the best way to do this would be to make a custom Date class extending the PropertyEditorSupport, and implementing the setAsText method.

[My Blog]
All roads lead to JavaRanch
subject: jsp:setProperty with java.util.Date