7 Replies Latest reply on Dec 20, 2005 2:10 PM by dsimon

    error-page definitions?

    dsimon

      I seem to be having problems defining a custom error page for my portal application.

      I have tried inserting the following:

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

      into:

      deploy/jbossweb-tomcat55.sar/conf/web.xml
      deploy/jbossweb-tomcat55.sar/ROOT.war/WEB-INF/web.xml
      deploy/somePortlet.war/WEB-INF/web.xml

      no luck with any of those files -- we still see a stack trace whenever an error occurs, rather than the error page defined.

        • 1. Re: error-page definitions?

          you'll need to place your error page into the portal-server.war's web.xml.

          • 2. Re: error-page definitions?

            is it possible to define/store the error pages or login pages into cms repository?

            If it is possible, this will make system more easy to change.

            yang

            • 3. Re: error-page definitions?
              dsimon

              Using JBoss AS 4.03SP1 and Portal 2.01RC1, this does not appear to work.

              in the file deploy/jboss-portal.sar/portal-server.war/WEB-INF/web.xml:

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


              in one of the back-end JSP pages which drive a portlet:

              <%
              if (true) {
              throw new Exception("Testing error");
              }
              %>

              The exception is thrown, but the resulting page is simply showing a stack trace in place of the portlet, not the error page.

              • 4. Re: error-page definitions?

                I think your web.xml entry isn't correct. Try something like:

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




                • 5. Re: error-page definitions?
                  dsimon

                  That's actually what I had....not sure why it posted the way it did above....still doesn't work.

                  • 6. Re: error-page definitions?

                     

                    "yxyang" wrote:
                    is it possible to define/store the error pages or login pages into cms repository?

                    If it is possible, this will make system more easy to change.

                    yang


                    The problem here is that most enterprise deployment remove the CMS. Perhaps we can make it configurable in the future.

                    • 7. Re: error-page definitions?
                      dsimon

                      *bump*

                      Any word on how I can fix this? The web.xml entry that I have is (to the best of my knowledge) correct, but it does not seem to have any effect when an error is thrown during the rendering of a portlet (the stack trace is shown in place of the portlet).

                      The behavior that I'm seeing is that the portal renders the theme and puts the stack trace in place of the portlet that threw the exception. If there are multiple portlets on the page, the other portlets will render normally.

                      What I need is for either the output of the individual portlet to show the error page when an error is generated or for the entire page to revert to the error page when one of the portlets throws an exception.

                      Is this not possible in portal?