Struts 2 : redirect to action method on type conversion fail ?

2010-05-10 Thread Thomas Lulé
Hi, I've got a form with s:textfield mapped with Long variables in my action class. Also, my jsp displays some pre-computed information (that I retrieve from database in my action's method). When the user types letters in the number field, the type conversion fails, and the JSP is reloaded. But

Re: Struts 2 : redirect to action method on type conversion fail ?

2010-05-10 Thread Lukasz Lenart
Use Preparable interface instead http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/Preparable.html Regards -- Łukasz http://www.lenart.org.pl/ Kapituła Javarsovia 2010 http://javarsovia.pl - To

Re: Struts 2 : redirect to action method on type conversion fail ?

2010-05-10 Thread Thomas Lulé
That interceptor looks great, but is there any way to access request parameters in the prepare() method ? The http request provides an archiveProfileId parameter and I use that parameter to load my object archiveProfile. 2010/5/10 Lukasz Lenart lukasz.len...@googlemail.com: Use Preparable

Re: Struts 2 : redirect to action method on type conversion fail ?

2010-05-10 Thread Alex Rodriguez Lopez
Hi Thomas, use the paramsPrepareParams interceptor stack (or change yours), from struts-default.xml: !-- An example of the paramsPrepareParams trick. This stack is exactly the same as the defaultStack, except that it includes one extra interceptor before the

Re: Struts 2 : redirect to action method on type conversion fail ?

2010-05-10 Thread Thomas Lulé
It works. Thanks a lot Lukasz and Alex. 2010/5/10 Alex Rodriguez Lopez alo...@flordeutopia.pt: Hi Thomas, use the paramsPrepareParams interceptor stack (or change yours), from struts-default.xml: !-- An example of the paramsPrepareParams trick. This stack                 is exactly the

Re: Struts 2 : redirect to action method on type conversion fail ?

2010-05-10 Thread Thomas Lulé
One last thing : Even if everything works, I still get a stacktrace when I submit the form to save my object. I think that the params interceptor tries to set the properties of the object jspProfile I have in my form (with s:checkbox name=jspProfile.recpCheckErrorCount/ for example), before the

Re: Struts 2 : redirect to action method on type conversion fail ?

2010-05-10 Thread Thomas Lulé
Nevermind, my stacktrace came from that issue : https://issues.apache.org/jira/browse/WW-2850 2010/5/10 Thomas Lulé tho...@lule.fr: One last thing : Even if everything works, I still get a stacktrace when I submit the form to save my object. I think that the params interceptor tries to set