3 Replies Latest reply on Jun 4, 2010 10:25 AM by Ambrish Singh

    Back Button on Error page

    Ambrish Singh Newbie

      Hi Everyone,


      I have a error page which is displayed whenever an AuthorizationException occurs. Now I want to provide a back button on this error page so that the user can go back to the page from where this AuthorizationException has occurred.


      Here is my pages.xml file :




      <exception class="org.jboss.seam.security.AuthorizationException">
              <redirect view-id="/error.xhtml">
                  <message>You do not have the necessary security privileges to perform this action.</message>
              </redirect>
      </exception>




      How Can I store the last visited page before exception?



      Regards,


      Ambrish

        • 1. Re: Back Button on Error page
          Sean Tozer Newbie

          Well, the login capture happens in components.xml:


             <event type="org.jboss.seam.security.loginSuccessful">
                <action execute="#{redirect.returnToCapturedView}"/>
                    <action execute="#{currentSession.setMaxInactiveInterval(3600)}"/>
             </event>


          Is there an event thrown when the authorization exception happens? Or does the exception itself count as an event. I'd be trying to figure out something in there.

          • 2. Re: Back Button on Error page
            Sean Tozer Newbie


               <event type="org.jboss.seam.security.loginSuccessful">
                  <action execute="#{redirect.returnToCapturedView}"/>
                      <action execute="#{currentSession.setMaxInactiveInterval(3600)}"/>
               </event>



            Mixed up my format notation, once again.

            • 3. Re: Back Button on Error page
              Ambrish Singh Newbie

              Hi Sean,


              Thanks for the reply.


              Actually my requirement is that I don't want to go back to login page again. I will provide a back button on error page so that the user can go back to previous page from where exception was generated.


              No there is no event associated with AuthorizationException.


              Regards,


              Ambrish