struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vEnkaTa mohAna rAo SriperumbUdUru <mohanara...@gmail.com>
Subject Re: Store Interceptor not working with field error (using Hibernate validation)
Date Fri, 21 Dec 2012 16:50:01 GMT
<action name="applicationFailed" ....>
   <interceptor-ref name="store">
      *<param name="operationMode">RETRIEVE</param>   <!--
operationMode missed -->*
   </interceptor-ref>
   <result>applicationFailed.jsp</result></action>



On Fri, Dec 21, 2012 at 3:57 PM, cyanoboy <marcox872002@libero.it> wrote:

> I have a Jsp with some textfields, these are validate using Hibernate
> validation annotation (@Valid or @NotNull in the action) except one (input
> image file) that is validate with default Struts2 validation (using
> ActionName-validation.xml). I want to redirect to another action when the
> submitted form is invalid (when textfields are null), and I want to store
> fields error.
>
> I tried with this:
>
> <interceptors>
>     <interceptor name="SessionCheckInterceptor"
> class="util.SessionCheckInterceptor"/>
>         <interceptor-stack name="mySessionValidationStack">
>             <interceptor-ref name="defaultStackHibernate" />
>             <interceptor-ref name="SessionCheckInterceptor" />
>         </interceptor-stack>
> </interceptors>
>
> <default-interceptor-ref name="mySessionValidationStack"/>
>
> <action name="insert" class="actions.InsertAction" >
>     <interceptor-ref name="mySessionValidationStack">
>         image/png
>     </interceptor-ref>
>     <interceptor-ref name="store">
>         STORE
>     </interceptor-ref>
>     <interceptor-ref name="defaultStack" />
>     <result name="success" type="tiles" >baseLayout</result>
>     <result name="error" type="redirectAction" >
>         showinsertform
>     </result>
>     <result name="input" type="redirectAction" >
>         showinsertform
>     </result>
> </action>
>
> <action name="showinsertform" class="actions.ShowInsertFormAction" >
>     <interceptor-ref name="mySessionValidationStack" />
>     <interceptor-ref name="store">
>         RETRIEVE
>     </interceptor-ref>
>     <result name="success" type="tiles" >insert</result>
>     <result name="error" type="tiles" >baseLayout</result>
> </action>
>
> But when I sumbit the form, the redirect succeed without showing me fields
> error messages. Maybe I'm setting wrong the interceptor? Using hibernate I
> need to override something? If I try to set manually error messages in the
> action (with addActionError), they works! Can it be that hibernate error
> fields messages are not stored in the session?
>
>
>
> --
> View this message in context:
> http://struts.1045723.n5.nabble.com/Store-Interceptor-not-working-with-field-error-using-Hibernate-validation-tp5711481.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message