0 Replies Latest reply on Jul 27, 2010 8:26 AM by Tom G.

    ViewExpiredException message by a4j components

    Tom G. Newbie

      Hi all,

      I'm trying to handle the ViewExpiredException in the current web project. It work's with JSF 1.2, Seam 2.2 and Richfaces 3.3.1.

      These exception should be handle on server side. If the current view expired and you make a full request (e.g. press h:commandButton) you are redirect to the login view and the error message is displayed.

       

      So far, so good.

       

      Now... e.g. you switch the a4j tab, you are redirect to the login page but no error message are displayed! Does anybody know why?

       

      Here my configuration...

      components.xml

      ...

      <core:init debug="false" jndi-pattern="@jndiPattern@"/>

      ...

       

      web.xml

      ...

      <context-param>

                <param-name>facelets.DEVELOPMENT</param-name>
                <param-value>false</param-value>
           </context-param>
           <context-param>
                <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                <param-value>server</param-value>
           </context-param>
           <session-config>
                <session-timeout>1</session-timeout><!-- #test config -->
           </session-config>
      

      ...

       

      pages.xml

      ...

           <exception log="false">

                <redirect view-id="/login.xhtml">

                   <message severity="warn">Your session has timed out, please try again</message>

                   <!--param name="viewExpired" value="true" /-->

                     <!-- #backing bean with @RequestParameter("viewExpired") -->

               </redirect>

           </exception>

      ...


      login.xhtml

      ...

      <h:messages id="errorMessage" styleClass="message"/>

      ...

       

      textViewExpired.xhtml

      ...

      <h:form>

      <h:commandButton action="xyz" value="h:xyz"/>

      <a4j:tabPanel switchType="ajax">

           <a4j:tab switchType="ajax" label="ajaxTab x">...</a4j:tab>

           <a4j:tab switchType="ajax" label="ajaxTab y">...</a4j:tab>

      </a4j:tabPanel>

      </h:form>

      ...

       

       

      PS:

      • I have try to use param attribute in pages.xml. But it doesn't arrive in the login backing bean.
      • Last way: client side handling