File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes form-property  :  newbie question 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 "form-property  :  newbie question" Watch "form-property  :  newbie question" New topic
Author

form-property : newbie question

Scott
Greenhorn

Joined: Sep 27, 2002
Posts: 9


Newbie: This is my first time using struts.

I have created an application and I would like one of my forms to allow for the submission of various dates. I have decided to use java.util.Calendar for all of my dates in this application.
How should/can I do this using struts?
What is the proper way to setup the struts-config.xml file for this to work?

Here is some code I have:

<form-beans>
<form-bean name="SearchByDateForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="actualAwardBeginDate" type="java.util.Calendar">
<form-property name="actualAwardEndDate" type="java.util.Calendar">
</form-beans>

If I change the property from java.util.Calendar to type=java.lang.String, how and where in the app do I need to change this to a Calendar object?

Thanks!!!
[ September 22, 2004: Message edited by: Joe Blow ]

Scott<br />Never under estimate the wisdom of nature!
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

In the Action, probably after you've validated that it is a valid date.


A good workman is known by his tools.
Scott
Greenhorn

Joined: Sep 27, 2002
Posts: 9
So does this mean I should change the property type in the form bean to java.lang.String or leave it as Calendar?
[ September 22, 2004: Message edited by: Joe Blow ]
Scott
Greenhorn

Joined: Sep 27, 2002
Posts: 9
Disregard my last reply. I figured out what you meant. Your advice was very helpful. Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: form-property : newbie question