1

I want to hide the xhtml page name when redirecting, url should be user defined. For All redirecting pages the URL should be same only the content of the page should be changed. how i need to implement this in primefaces without using third party tool like pretty faces.

vels4j
  • 11,208
  • 5
  • 38
  • 63
Arunkumar
  • 11
  • 3
  • 1
    Primefaces is for UI framework and nothing to deal with url rewrite – vels4j Apr 17 '14 at 05:29
  • 1
    Why do you want to hide the url ? – Makky Apr 17 '14 at 09:22
  • I don't want to hide the URL just i want to change to common URL for security purpose. i don't want to display the jsf page name directly in the URL. suppose i am login to the particular application and it is redirecting to the home page, the homepage jsf page name will be displayed in the URL. suppose if i need to navigate to some other page like "Application creation" the content of the page should be redirected to the Application creation page but my URL should be in home page jsf page name itself. how i will achieve this is there any way? – Arunkumar Apr 17 '14 at 11:14

1 Answers1

0

First of all, what you are talking about is not URL rewriting.

By 'URL Rewriting' we mean to show more user friendly URL instead the one your page already have.

If what you want to achieve is to have only one URL for all of your pages, maybe your should use ui:include with rendered tag for every page in your home page and keep your page name in session scoped bean, which is BAD idea and NOT a good practice. More of this is explained here: How to include another XHTML in XHTML using JSF 2.0 Facelets? and what you need to add is this:

<ui:include src=".../PageOne.xhtml" rendered="#{mySessionBean.pageToShow.equalsIgnoreCase('PageOne')}" >

Anyway I don't really see any security based reason why would you need to do this. Maybe you are looking for an answer in a wrong direction.

I will let you decide if you need this or not.

Community
  • 1
  • 1