WebSphere Portal Server - JSF portlet (jsr 168) error handling - why oh why...

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > May 2006 > JSF portlet (jsr 168) error handling - why oh why...





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author JSF portlet (jsr 168) error handling - why oh why...

2006-05-10, 7:19 am

Hey everybody

Why is there no documentation on jsf portlet error handling?

You can't use error-page in web.xml and everybody always write about how you can easily navigate to an error page from your action method.

But what if the exception occurs outside of an action method?

For instance when a h:outputtext fetches its value in a faces managed bean - what if the specific getter throws an exception.

Or when a faces managed bean is first constructed before the page is actually loaded.

How do you all handle these situations?

/Chr

2006-05-10, 1:17 pm

You can display a message in this case using the <h:message> tag. Here's a simple example:

<h:outputText id="outputText" value="#{managedBean.value}"/> <h:message id="errorMessage" for="outputText"/>

2006-05-10, 1:17 pm

Yes that is true, but what if want to go to an error page instead?
Jerome Curlier

2006-05-10, 7:15 pm

what about using the JSP directive:

<%@page language="java" errorPage="error.jsp"%>

JC

<christian.landbo.frederiksen@ementor.dk> wrote in message
news:1590866879.1147271053170.JavaMail.wassrvr@ltsgwas007.sby.ibm.com...
> Yes that is true, but what if want to go to an error page instead?



2006-05-11, 7:19 am

errorPage="error.jsp"

Yep I'm going that way now, but I can't make it work. I keep getting a PortletException (Assertion Failed) error after error.jsp:init.

I tried to make error.jsp a standard jsp and not a Faces jsp - then it worked??

I don't know why the error.jsp cannot be a Faces jsp but I would like it to be so I can use Messages etc.

Has anybody has any luck using a Faces error page and if so can you get to the exception in the backing beans so you can log it and present as a Message.

/Chr


riaanm

2006-05-12, 7:16 am

The JSF assertion error usually occurs (in my experience) when a certain JSF tag is not preceded by another required JSF tag. Like placing a h:commandButton not inside a h:form or f:view.

It is a poor implementation by not letting you know what is required by the failing JSF tag.

------------------------
Riaan Minne
IBM South Africa
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com