File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring 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="" 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:
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

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
I agree. Here's the link:
subject: jsp:setProperty with java.util.Date
jQuery in Action, 3rd edition