250 total views, 8 views today
Rewrite JSF 2.0 URL using PrettyFaces
Pretty Faces is an open source solution to rewrite URL in JSF and J2EE frameworks. It makes the URL pretty and SEO-friendly. As an example, We could replace our JSF URLs from /faces/* to /* in 2 minutes. In this section, we have mentioned how to rewrite URL in JSF using Pretty Faces
Old URL: http://localhost:9090/catgovind/faces/index.xhtml
New URL: http://localhost:9090/catgovind/index
Add the prettyfaces-jsf2-3.3.3.jar file into your <project>\WEB-INF\lib folder.
Create pretty-config.xml under your <Project>\WEB-INF folder. The final Project structure will look like below
Edit the pretty-config.xml and add URL-mapping point to your xhtml file as shown below.
<pattern value="/index" />
<view-id value="/faces/index.xhtml" />
Test it in browser
Download Source Code: JSF URL rewritten in Pretty Faces
The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.
Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply 🙂
Latest posts by Govind
- How to encode and decode base64Binary datatype in Oracle BPEL - December 11, 2017
- How to Read a File using Oracle BPEL File Adapter Example - December 11, 2017
- How to write a File using Oracle BPEL File Adapter Example - December 10, 2017