Re: Exception Handling with Seam

Splash Forums PrettyFaces Users Exception Handling with Seam Re: Exception Handling with Seam

#22132

Let me explain how PrettyFaces works. I think it’s the best way to understand the meaning of the dispatchers. The dispatcher setting specifies for which requests the filter is applied. The default setting (no dispatcher element at all) means it will be applied only to REQUEST type requests (the standard case).

Example mapping:

<url-mapping id="home">
<pattern value="/home" />
<view-id>/faces/index.xhtml</view-id>
</url-mapping>

If the user accesses the URL /home the following happens: The requests is catched by the PrettyFilter very early (the PrettyFilter should be the first filter configured). It is applied because the PrettyFilter is configured to match for REQUEST type requests. PrettyFaces now forwards the request to /faces/index.html inside the Servlet engine. This means that for the application it looks like /faces/index.html was requested by the user. The only difference from a standard request is that the forwarded request isn’t handled as a REQUEST but as a FORWARD.

If you configure the SeamFilter like you did before it will only catch REQUEST but not FORWARD requests. So the Seam filter won’t be applied to the request forwarded by PrettyFaces. That’s the reason you typically have to configure most of your filter to be also valid for FORWARD requests.

We have a small section in the FAQ that mentions the filter dispatcher settings. See the second question here:

http://ocpsoft.com/docs/prettyfaces/3.3.2/en-US/html/FAQ.html

I hope this clears up the situation a bit! :)

Christian