views:

27

answers:

1

Hi,

How can I catch and handle the PortletException thrown by GenericPortlet.doView()? I'd like to show a custom error page or custom message in JBoss portal if this exception is thrown for some reason.

A: 

The Portlet 2.0 spec (JSR 286 - but I doubt they took out error handling) says:

It is left to the portal/portlet-container implementation how to react when a portlet throws an exception while processing a request. For example, the portal/portlet-container could render an error page instead of the portal page, render an error message in the portlet 25 window of the portlet that threw the exception or remove the portlet from the portal page and log an error message for the administrator.

JBoss Portal's error handling doesn't seem to offer what you want.

You'll probably have to handle this yourself, perhaps by defining an abstract base class that your other portlets can extend.

McDowell