• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

form-property : newbie question

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Disregard my last reply. I figured out what you meant. Your advice was very helpful. Thanks.
reply
    Bookmark Topic Watch Topic
  • New Topic