4 Replies Latest reply on May 14, 2009 4:59 AM by ilya_shaikovsky

    Error page not shown on ajax request to commandButton listen

    tuestone

      Hello,

      I have a general (and maybe rookie) question regarding ajax requests on click events for a4j:commandButton components. Maybe some answers can help me out of a problem that I have been working on for a while.

      I have defined an error page in web.xml:

      <error-page>
       <exception-type>java.lang.Exception</exception-type>
       <location>/error.jsp</location>
      </error-page>
      


      When an exception occurs either in the JSF page (parsing exception or whatever) or in a method of a backing bean, then everything works fine and the error page is displayed. However, if I press an a4j:commandButton which has an action listener method attached to it, then I get the effect that any thrown exceptions prevent the error page to be displayed, i.e. the browser displays the current page and the stack trace is written to the console.

      The commandButton looks like this:

      <a4j:commandButton type="submit" value="#{msg_log.adminLog_button_apply}" actionListener="#{AdminLog.updateLogList}" reRender="ajaxArea" eventsQueue="ViewQueue">
       <a4j:actionparam name="nextView" value="/protected/pages/logs/adminlogs.jsp" assignTo="#{ViewHandler.currentView}" />
      <j4j:defaultAction />
      </a4j:commandButton>


      When I set a breakpoint in my error.jsp, I can see that the request is not even forwarded to that page since the breakpoint is not reached.

      Can anybody please explain to me why on ajax requests the web container apparantly does not forward the request to the error page?

      I am using JBoss 4.2.2, JSF 1.2 RI and Richfaces 3.2.1 / 3.2.2.

      Thanks for your help and comments!