Announcement Announcement Module
No announcement yet.
Portal: Redirect on Exception Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Portal: Redirect on Exception

    I am working on a Weblogic 10 portal. We are using the SimpleMappingExceptionResolver to trap exceptions and render the appropriate error pages.

    The problem is some errors need to be catastrophic and redirect to a "System Down" portal page. However, because we are in the render phase during the exception handler (methods use RenderRequest/RenderResponse) you can't redirect. The only option is telling the portal what view to render in the portlet. If the user is on a page with four portlets, I don't want one portlet to have an error in it. The whole page needs to change to a page with a single portlet with the error verbiage.

    I have a "hack" working right now that I am extremely dissatisfied with. An error.jsp is used as the error view. This page has javascript in it to fire an AJAX call to raise an event. The error page is listening for that event and displays when it happens. YUCK, redirecting through the client browser to get to the error page?

    Any help on how to do this cleanly? It has to be a very common issues. Who can live with errors only being handled portlet-by-portlet? Somehow you have to be able to hook into page navigation at the portal level.


  • #2
    Part of the question here then is when your exception is occurring. Is it happening during the action phase or the render phase?

    If it is happening during the render phase, then there is really nothing else you can do through the spec. It's already too late to request a redirect or to change the window state of your portlet. There may be something else Weblogic-specific you can do, but that's a hack of a different stripe and a question for a different forum.

    If the exception occurs during the action phase, you can intercept it and do something about it via the spec. By default, DispatcherPortlet catches any exception that escape your action phase and stores it in a session attribute whose name is in DispatcherPortlet.ACTION_EXCEPTION_SESSION_ATTRIBU TE
    and sets a render parameter whose name is in DispatcherPortlet.ACTION_EXCEPTION_RENDER_PARAMETE R. So, you could build an Interceptor that detects those at the end of the action request and then causes a redirect or changes the window state or does whatever you want.

    Hope that helps!