OCPSoft.com - Simple SolutionsCommunity Documentation

Chapter 12. FAQ

  1. Q. Can I use PrettyFaces to handle UrlRewriting for other (non-JSF) resources on my server?

    A. Yes. PrettyFaces still requires a configured JSF instance to function, but it can be used to map a URL to any resource in the Servlet Container – without invoking FacesServlet. Values will be injected into JSF beans as usual, but PrettyFaces Action methods will not trigger (since no JSF lifecycle executes for non-Faces requests.)

  2. Q. Why do my Tomahawk / MyFaces components, or other 3rd party add-ons, break when I use PrettyFaces?

    A. Since PrettyFaces intercepts mapped HttpRequests then forwards those requests to JSF, it is necessary to enable any additional filters between PrettyFaces and JSF to listen to Servlet Forwards. This is done in the web.xml deployment descriptor by adding the following dispatcher elements to any needed Filters:

  3. Q. Why, when using MyFaces, am I getting a NullPointerException when I try to use normal faces-navigation?

    A. Some MyFaces versions do not completely comply with the JSF specification, thus the ViewRoot is null when the request is processed. There is a patch/workaround, which can be added to fix this issue. You must add this ViewHandler to your faces-config.xml.

  4. Q. Can I configure PrettyFaces via Annotations?

    A. Yes – please refer to Annotation based configuration for details.

  5. Q. How do I enable logging, so that I can tell what the heck is really going on?

    A. Create or update your log4j.properties file with the following values:

  6. Q. Can I map and process URLs that span a dynamic number of ‘/’ characters?

    A. Yes, please read about custom path-parameter patterns.

  7. Q. How do I save FacesMessage objects after performing a redirect or pretty:redirect?

    A. You need to configure the optional MultiPageMessagesSupport PhaseListener (or something like it.) JBoss Seam provides a Messaging API that goes above and beyond JSF, providing this feature automatically.

    See Preserving FacesMessages across redirects or this article for a full explanation of how this works.

  8. Q. Does PrettyFaces work on IBM’s WebSphere?

    A. Yes, but websphere requires a custom setting in order to behave like a sane server.

  9. Q. Why are non-ASCII characters distorted when using mod_jk?

    A. This can happen because mod_jk partially reencodes the request URL after processing them inside Apache httpd and before forwarding it to Tomcat. You should set the following option to let mod_jk forward the unparsed URL.

  10. Q. My Orchestra conversationContext parameter is not working with PrettyFaces?

    A. This can happen depending on JSF version and Orchestra version where Orchestra does not properly override encodeRedirectURL. To solve this problem, enable the following context parameter in your web.xml: