Thank you Jeff for the reply.
did u mean the *converter* attribute of the action tag that we give in
struts.xml? I didnt give any such attribute in it. I added
ActionClass-conversion.properties: in which i mentioned the attribute to
pickup a class which implements convertFromString and viceversa functions.
My action tag in the xml are as follows:
<struts>
<package name="eventsCreation" namespace="/event"
extends="struts-default">
<interceptors>
<interceptor name="..." class="..." />
<interceptor name="..." class="..." />
</interceptors>
<action name="oneAct" class="oneClass">
<interceptor-ref name="...">
...
</interceptor-ref>
<result>one.jsp</result>
</action>
...
let me know if you are looking for anything else.
cheers,
ravi
Jeff Hill (RR) wrote:
>
> Ravi,
> From my understanding of OGNL, it *should* use the model object's
> conversion
> descriptor. It's probably more surprising that it called convertFromString
> without it. Are you using defaultStack?
>
> I believe providing the model object's descriptor is the correct approach,
> and you indicate that it's working. So why the long face? ;-)
>
> -----Original Message-----
> From: ravi_eze [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 24, 2008 11:45 PM
> To: [email protected]
> Subject: Type converters: please help!!! :(
>
>
> hi,
>
> i badly need the solution to this problem. i had posted this issue on
> xwork
> forums, struts fourms previously also, but hardluck: no reply :(
>
> i am reposting the same again... atleast let me know if this idea itself
> is
> wrong!!! or any better approach/ is there?
>
>
> ravi_eze wrote:
>>
>> hi,
>>
>> We have Action class with Employee Object with setters and getters. The
>> Typeconverter was configured to be called when <EmployeeObject.empId> is
>> called by the jsp page. We found that convertFromString of type converter
>> is being called but convertToString is never called. Any idea why this is
>> happening? The details are as follows:
>>
>> Type converter:
>> public class LongConverter extends StrutsTypeConverter {
>> public Object convertFromString(Map context, String[] values, Class
>> toClass) {
>> ... ....
>> }
>> public String convertToString(Map context, Object o) {
>> ... ....
>> }
>> }
>>
>> in actionClass-conversion.properties located along with the class file in
>> the same package:
>> employee.empId=com.comp.util.converter.LongConverter
>>
>> After some debugging we found that we need to add a new file:
>> Employee-conversion.properties in the same package of Employee class with
>> entries:
>> empId=com.comp.util.converter.LongConverter
>>
>> and only then the convertToString would be called. I think we should have
>> only one conversion.prop file instead of 2. Any ideas why this is
>> happening this way? or am i missing any thing? please help.
>>
>> cheers,
>> ravi
>>
>
> --
> View this message in context:
> http://www.nabble.com/Type-converters%3A-convertToString-not-called-tp150349
> 25p15080943.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Type-converters%3A-convertToString-not-called-tp15034925p15081469.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]