struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Williams <>
Subject Behavior of <s:param> tags with date values
Date Fri, 13 Apr 2012 16:50:26 GMT

I am experiencing some unexpected behavior with the Struts2 <s:param> tag when using
it with date values. When I try to use an <s:param> tag within <s:url> to pass
a date argument, the date is not output in the DateFormat.SHORT format, resulting in a type
conversion error on submission.

For example, theseĀ  struts tags:

<s:url id="anchorUrl" namespace="/experiment" action="go" escapeAmp="true">
 <s:param name="inDate" value="inDate"/>
<s:a href="%{anchorUrl}" id="go">Click this here...</s:a>

produce this output:

<a id="go" href="/EXP/experiment/go.action?inDate=Thu+Apr+12+21%3A52%3A30+EDT+2012">Click
this here...</a>

With HTML escaping removed, the result is "Fri Apr 13 12:31:00 EDT 2012", a format that nests
the time inside the date.

Unsurprisingly, this is causing a type conversion error when submitted to the Action class.
I'm perplexed -- could I be misunderstanding the tags' usage, and this the expected behavior?
Or might this be a bug, perhaps?

Many thanks,

Scott Williams

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message