[jboss-user] [JBoss Seam] - Exceptions in page param converters
adamw
do-not-reply at jboss.com
Wed Oct 24 17:45:44 EDT 2007
Hello,
I have an @ApplicationException, which I want to handle with Seam.
In particular, I want to convert a page parameter to an entity, and if the page parameter points to a non-existing entity, an exception is thrown.
The exception is defined as follows:
| <exception class="item.ItemNotFoundException">
| <redirect view-id="/error.xhtml">
| <message severity="ERROR">The item was not found.</message>
| </redirect>
| </exception>
|
If I do:
| <page view-id="/item/item_view.xhtml" action="#{itemView.loadItem}">
| <param name="name" value="#{itemView.itemName}" />
| </page>
|
and the "#{itemView.loadItem}" method throws an exception, the browser redirects to /error.xhtml, and the message is displayed.
But if I do:
| <page view-id="/item/item_edit.xhtml">
| <param name="name" value="#{itemEdit.item}" converter="#{itemConverter}" />
| </page>
|
and the converter throws an excpetion, the browser still redirects to /error.xhtml, but the message is not displayed. How can I change that? Obviously, conversion happens at an earlier phase than rendering the response, so the exception can be caught (and is :) ), but maybe I don't see the message because the conversation context isn't yet created?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098591#4098591
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098591
More information about the jboss-user
mailing list