2 Replies Latest reply on Jun 11, 2011 2:00 PM by lvdberg

    pages.xml and exception handling

    danclemson

      Hi,


      In pages.xml, framework-level exception handling often gets redirected to an error.xhtml page:


      <exception class="org.jboss.seam.security.AuthorizationException">        
              <redirect view-id="/error.xhtml">
                  <message severity="error">You don't have permission to access this resource</message>
              </redirect>
      </exception>




      Is there any way that I can display the error message on the current page instead of redirecting to an error page. For example, user is at the detail.seam page and click the delete button and this triggers the AuthorizationException(as this user has no delete previlege). Can I display the error message on the detail.seam page instead of redirect the user to the error page?


      I tried

      <redirect view-id="#{facesContext.viewRoot.viewId}">

      to stay with current page. This does not work.


      Thanks /dan