struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olivier H. Beauchesne" <>
Subject Re: [s2] s:url includeParams and StrutsTypeConverter
Date Sun, 05 Jul 2009 15:15:09 GMT

I've found a workaround. It the url tag, I use this ognl script: 
fromDate.Time, this will convert the date into a long. The TypeConverter 
will then see if my field(fromDate) contains only numbers or a formatted 
date. From there it will convert it to a date. It's a hack, but it works.

I didn't find an answer my second question, why the string "templateDir" 
is sent to my TypeConverter if I restrict the TypeConverter to an Action?

I would like an answer to this question though: Is this behavior 
expected or is it a bug? If so, I will fill out a bug report.



Olivier H. Beauchesne wrote:
> Hi,
> I'm using a StrutsTypeConverter to convert Date objects into localized 
> formatted strings to switch between locals. It works really well with 
> <s:textfield> but not with <s:url> tags. The parameters don't pass 
> through the StrutsTypeConverter like the fields. I'm using a 
> to convert all java.util.Date objects.
> Is this a bug or a known limitation? If so, is there a workaround?
> Also, when I tried to restrict the conversion to an action, it didn't 
> work because my converter would receive the dates from the fields but 
> also a string with "templateDir" inside of it. When I returned an 
> exception and/or a null value, struts crashed saying I had specified a 
> null value and it couldn't find the template field. Surely, it must be 
> a bug?
> I'm using 2.1.7.
> Thanks,
> Olivier
> P.S.: english is my second language, so forgive me.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message