Hi,

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.

Thanks,

Olivier

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 xwork-conversion.properties 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: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to