You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by "Emandi, Srinivasrao" <sr...@logicacmg.com> on 2006/01/09 07:48:57 UTC

How to handle exception ????

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 this...
Thanks in advance...


This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

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


Re: How to handle exception ????

Posted by Aaron Evans <aa...@yahoo.ca>.
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
this...
> 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
this:

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


Re: How to handle exception ????

Posted by Santiago Gala <sg...@apache.org>.
El lun, 09-01-2006 a las 09:33 -0800, David Sean Taylor escribió:
> Emandi, Srinivasrao wrote:
> > 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 this...
> > Thanks in advance...
> > 
> The portlet spec does not cover the declaration of error pages, but in 
> your application you are free to forward to a JSP page on error.
> 
> If you want the portal to handle the exception, throw a PortletException
> A new feature for configurable error pages handled by the portal would 
> be valuable in my opinion
> 

I think the same. Basically, the layout/decoration should probably be
parameterized to specify one of:
- ignore completely faulty portlets (skip even layout)
- divert to error template with several extra variables set

Not sure how easy to do that, though.

Regards
Santiago

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> 
-- 
VP and Chair, Apache Portals (http://portals.apache.org)
Apache Software Foundation

Re: How to handle exception ????

Posted by David Sean Taylor <da...@bluesunrise.com>.
Emandi, Srinivasrao wrote:
> 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 this...
> Thanks in advance...
> 
The portlet spec does not cover the declaration of error pages, but in 
your application you are free to forward to a JSP page on error.

If you want the portal to handle the exception, throw a PortletException
A new feature for configurable error pages handled by the portal would 
be valuable in my opinion

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