Skip to Main Content

Application Development Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Redirect to Error page when an exception occuers

676901Dec 22 2008 — edited Dec 23 2008
Hello,

I want to catch all exceptions, it may happen in the main portal page or inside a portlet.
When ever there is an exception, I want to redirect the user to and tell him to try after sometime.

I already have such a feature for 404 (page not found), which works fine.
But for exception its not working

The setting in have in web.xml is

<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>


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


I even tried putting exact exception thrown from the on screen stack trace, like

<error-page>
<exception-type>javax.ejb.EJBException</exception-type>
<location>/error.jsp</location>
</error-page>

But still no use. I get the main portal's header and then the menu bar, and few portlets and the one portlet that is generating exception, still prints the full stack trace and that kills the alignment, making a complete mess.


I have weblogic 10.2 or weblogic 10.3.


Is there any way, I can catch, where ever exception happens and redirect the user to the custom error page.


Thanks in Advance

--
Parvez
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 20 2009
Added on Dec 22 2008
6 comments
1,855 views