I wonder if anyone can help.
I'm trying to create a new struts2 tag to render and operate as a 3 field date control. IE. a single
jsp tag which results in 3 html input controls nicely laid out. Ignoring the complications of individual field validations (eg: month field is Feb, day field cant be > 28 unless year field is a leap year in which case it can be 29!). Anyway, ignoring that ..... I'm struggling with populating the value attribute.
I have a class which I'll use to store dates - its basically a wrapper around java.util.Date (I might use GregorianCalandar instead) which has getters and setters for day, month and year. In my action class I have a member variable whose type is my Date class, and I have a getter and setter for the field dob which gets and sets this member variable:
I reference my tag like this:
And my ftl looks like this:
The bit I'm having a problem with is the value attribute of each of the fields (where in the code above I've written it as value="problem area!")
What I think I want to do is in the jsp pass an ognl reference to the action class's member variable:
This I guess calls the action class's getDob method which will return the Date object. So then within the ftl I would want to do something like this:
But I cant get this (or similar syntax) to work.
As usual, any pointers very much appreciated !
Cheers
Nathan