David Harland wrote:
I have an action with a List<Message> messages. The
Message class has a Date senddate. In my jsp I am
iterating over the messages and want to create a s:url
with a param of formatedDate but I want to set the
value as a formatted version of senddate. I am
presently adding a getFormattedDate method which is
using SimpleDateFormat("dd/MM/yyyy
hh:mm:ss").format(senddate) in the Message class but I
don't want the formatting to be done in the Message.
Is there a more elegant way of doing this in the jsp please?


      _______________

This is a common question.  It's something like this:

<s:url href="....">
  <s:param name="theDate">
     <s:date name="date" format="dd/MM/yyyy"/>
  </s:param>
</s:url>


ie. that's an s:date tag within a s:param tag within an s:url tag. The formatted date is the body of the param tag.

It becomes more complicated when you need a locale dependent date or date conversion.

Hope that helps,
Jeromy Evans

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to