portals-jetspeed-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Evans <aaronmev...@yahoo.ca>
Subject Re: How to handle exception ????
Date Mon, 09 Jan 2006 13:16:34 GMT
Emandi, Srinivasrao <srinivas.emandi <at> logicacmg.com> writes:

> Hi all
> 	Can any one say , how to handle exception in portlet. Is there is any concept
of configuring an error page in
> portlet.xml as if it was done in web.xml.
> 	If any runtime excetion occurs i want to forward to error page, how to handle
> Thanks in advance...

I do not believe that there is any error page configuration for portlet in the 
portlet.xml like there is for servlets in web.xml.

Remember that you don't have control over certain aspects of the http response 
as this is the reponsibility of the portlet container/portal itself as it 
presents an aggregated view of many portlets.  So it would not make sense to 
base it on http error codes like in the servlet web.xml because the portal
is going to return 200, even if your portlet has an error.

I guess the question becomes, does J2 have any features for configuring
some kind of error display for exceptions generated by individual portlets.

In any event, if you are developing your own portlets, my suggestion would be

In your doView, doEdit, doHelp methods, wrap everything in a try/catch block,
and then in the catch, do an include of an error JSP page in your application.

To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org

View raw message