Reply To: What happened to PrettyFaces?

Splash Forums PrettyFaces Users What happened to PrettyFaces? Reply To: What happened to PrettyFaces?



Hi Chris,

As for @URLMappings, I’ve used it mostly as a storage of seo-friednly static pages with minimum functionality inside:

@URLMappings(mappings = {
	@URLMapping(id = StaticPages.MAPPING_HOME,     pattern = "/#{langBean.lang}/", viewId = "/faces/pages/pub/home.xhtml"),
	@URLMapping(id = StaticPages.MAPPING_ABOUT,    pattern = "/#{langBean.lang}/about/", viewId = "/faces/pages/pub/about.xhtml"),
	@URLMapping(id = StaticPages.MAPPING_CONTACTS, pattern = "/#{langBean.lang}/contacts/", viewId = "/faces/pages/pub/contacts.xhtml")
public class StaticPages {

	public static final String MAPPING_HOME = "p_mapping_home";
	public static final String MAPPING_ABOUT = "p_mapping_about";
	public static final String MAPPING_CONTACTS = "p_mapping_contacts";


@URLMappings(mappings = {
	@URLMapping(id = OrderBean.MAPPING_MAIN, pattern = "/order/#{orderBean.orderId}/", viewId = "/faces/pages/priv/order.xhtml"),
	@URLMapping(id = OrderBean.MAPPING_DETAILS, pattern = "/order/#{orderBean.orderId}/details/", viewId = "/faces/pages/priv/order-details.xhtml"),
	@URLMapping(id = OrderBean.MAPPING_HISTORY, pattern = "/order/#{orderBean.orderId}/history/", viewId = "/faces/pages/priv/order-history.xhtml")
public class OrderBean {

	public static final String MAPPING_MAIN = "p_mapping_order_main";
	public static final String MAPPING_DETAILS = "p_mapping_order_details";
	public static final String MAPPING_HISTORY = "p_mapping_order_history";
	private String orderId;

As you can see, there are different pages, different mappings, but the same functionality, e.g. retrieving order by it’s id or setting the language from user’s request.


Speaking of programmatic navigation I didn’t mean returning Navigate class instead of String (it’s nice but obvious), but rather building URL from Navigate entity and passing it to FacesContext for redirection, something similar to the code below:

PrettyURLBuilder builder = new PrettyURLBuilder();
String url =, false, new Object[]{1,2,3});

There is a simple example where it could be useful, personally I do it in every project, – sending activation or password recovery E-Mails containing action url like

  • This reply was modified 8 years, 7 months ago by  0swald.
  • This reply was modified 8 years, 7 months ago by  0swald.