• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

form-property : newbie question

 
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 ]
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic