aspose file tools*
The moose likes Struts and the fly likes Tags for displaying Date Input field in STRUTS? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Tags for displaying Date Input field in STRUTS?" Watch "Tags for displaying Date Input field in STRUTS?" New topic
Author

Tags for displaying Date Input field in STRUTS?

Pras Tiwari
Ranch Hand

Joined: Nov 07, 2005
Posts: 186
Hi,
I want to display Date input field in my struts1.1 web Application's view page. Currently I am displaying 3 input drop-downboxes for Date, Month & Year. But I think this is not good idea as it requires each time I have to validate date into my action class or through javascript . But to avoid this is there any readymade tag available in struts for diplaying date input on JSP page ?
Please help me I am struggling with this from so long.
Thank you in advance.
Pras


********Deserve Before You Desire********
Vani Bandargal
Ranch Hand

Joined: Oct 06, 2005
Posts: 82
1. All parameters are to be passed to and fro as Strings only.
There are some reasons why we need to follow this, though we can define
properties to be different type(boolean,Date) in your ActionForm.

2. We can use <fmt:formatDate tag so that data field can be displayed in any format(dd/mm/yy OR mm/dd/YYY ...)
Daniel Dalton
Ranch Hand

Joined: Mar 20, 2005
Posts: 146
Try this:

in your actionform use fields like:

In your business object Javabeans have the following:



In jou JSP refer to myDateDisplay in a text field. You can then use BeanUtils to copy the properties between the ActionForm and the Business object and your Bean will take care of the conversions.

Does that help?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tags for displaying Date Input field in STRUTS?