2 Replies Latest reply on Nov 3, 2006 3:03 PM by Jon Whitmore

    Error handling pattern?

    Jon Whitmore Newbie

      Hello

      I'm using Portal 2.2 and AS 4.03 SP1, and I'm having trouble finding information on error handling and error pages. Almost every page in my project displays multiple portlets, and when one portlet has an error the entire page fails to render.

      My goal is to find a safe approach to error handling that would allow the page to render the portlets without errors and replace the one that failed with a user friendly message. Is there a way to do this and still throw a PortletException from doView() or processAction()?

      I have found very little information on the subject and would appreciate some help or pointers to documentation.

      thanks

      nollie

        • 2. Re: Error handling pattern?
          Jon Whitmore Newbie

          Thanks Roy! I had not seen that.

          What I was hoping for was an opportunity to use my own error message which would fit within my margins and be a little more friendly. In any case someone had turned all those values off and I appreciate the tip.

          I had hoped to use my own messages with some error-page tags in my web.xml.

          <error-page>
           <exception-type>java.lang.Exception</exception-type>
           <location>/WEB-INF/jsps/exception.jsp</location>
           </error-page>
          <error-page>
           <exception-type>javax.portlet.PortletException</exception-type>
           <location>/WEB-INF/jsps/portletException.jsp</location>
           </error-page>


          but I can't seem to get this mechanism to work. If was using these error pages correctly would they fill the portlet, or replace the entire page? If the former, can you point me to information on the subject? I'm unsure which web.xml file this should be placed in - Do I define this for the entire portal or on a portlet by portlet basis?

          Thanks again!