Faced with a similar problem, I took a different approach. I created a tag that generates a set of day/month/year fields in the jsp and gets and sets values in a "FormDate" class which is a member of my form. The FormDate class handles conversions to/from a java.sql.Date. Although following the other comments in this thread I should perhaps use a java.util.Date and convert to java.sql.Date at the database layer.
David On Tue, 2002-10-01 at 12:03, Ronald Rotteveel wrote: > Dear all, > > I'm building a web application with the help of struts 1.0.2 (stable > release). > > In this webapp there are several forms with a date input field. I like to > make these input fields available in the following form: > > <select name="day"> > <option value="1">1</option> > <option value="2">2</option> > <option value="3">3</option> > etc. > </select> > > <select name="month"> > <option value="1">January</option> > <option value="2">February</option> > <option value="3">March</option> > etc. > </select> > > <select name="year"> > <option value="2002">2002</option> > <option value="2003">2003</option> > <option value="2004">2004</option> > etc. > </select> > > Now my problem is that date values are all stored in the database in the > timestamp format. How and where do I convert the values of the fields above > into the right timestamp value. Secondly I also would like to know how I can > set the above form input field in nice Struts tags. > > I know these questions are pretty basic, but I'm a rookie at Struts and I've > got two nice books where the are implementing Struts both at a bit different > way, so I hope you all could help me out here! > > Thanks in advance! > > > Regards, > > Ronald Rotteveel > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- David Whitmarsh Sparkle Computer Co Ltd Systems Development and Consultancy UNIX/LINUX/Windows, C/C++/perl/java Sybase Internet, Intranet, Security web: www.sparkle-cc.co.uk mob: +44 (0)7802 537097 ==========================================
signature.asc
Description: This is a digitally signed message part