Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

form-property : newbie question

 
Scott
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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 ]
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the Action, probably after you've validated that it is a valid date.
 
Scott
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Disregard my last reply. I figured out what you meant. Your advice was very helpful. Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic