views:

679

answers:

1

I am facing a lot of problems here in my jsp page. What tag I should use to get a date (yyyy-MM-dd) from user and store it in a Date property of a Struts2 action ?

The property in my action is declared to be of java.util.Date. I want the input from jsp page to land in this property.

please help.

I get Invalid field error (in JSP) if is use a s:textfield tag to manyally enter a date in the right format.

+1  A: 

There is an explanation of Struts2 date Format here at: Struts 2 Date Format Examples

But I believe the tag you are looking for in jsp is

<s:date name="Date_Name" format="yyyy-MM-dd" />

Where Date_Name is the Date object in Java.

tuckster
It didnt work. I have tried this
lakshmanan