0

Im using:

  • NetBeans
  • Maven web application
  • Java server faces
  • Primefaces

To navigate betwen pages im using:

            <p:menu>
                <p:submenu label="Menu">
                    <p:menuitem value="example 1 (google)"  outcome="googlePage" />
                    <p:menuitem value="Upload File's" outcome="uploadFiles" />
                    <p:menuitem value="example 3 (go to START)" outcome="index" />
                </p:submenu>
            </p:menu>

The 1st url looks like:

http://localhost:8080/projectName/

and than, when i want to go to other page the url is not looking good:

http://localhost:8080/projectName/faces/googlePage.xhtml

and the same for index page:

http://localhost:8080/projectName/faces/index.xhtml

what i need to do to make it more frendly?

mdrg
  • 3,242
  • 2
  • 22
  • 44
DarkMisha
  • 55
  • 2
  • 5
  • Can you show what is "friendly"? Give some example of what you "desire" and we will try help. – Cold Oct 09 '14 at 13:46
  • someting like this: localhost:8080/index || localhost:8080/index/somePage || i mean without this "faces" and project name. and why when i start my project the url is short and than when i want back to the start form is longer. – DarkMisha Oct 09 '14 at 14:12
  • See this link: http://stackoverflow.com/questions/3008395/jsf-facelets-sometimes-i-see-the-url-is-jsf-and-sometimes-xhtml-why – Cold Oct 09 '14 at 14:56

1 Answers1

0

I believe you can use Prettyfaces for that.

PrettyFaces is an OpenSource URL-rewriting library with enhanced support for JavaServer Faces – JSF 1.1, 1.2 and 2.0 – enabling creation of bookmark-able, pretty URLs. PrettyFaces solves the “RESTful URL” problem elegantly, including features such as: page-load actions, seamless integration with faces navigation, dynamic view-id assignment, managed parameter parsing, and configuration-free compatibility with other web frameworks.

Read more for example here and here.

Community
  • 1
  • 1
Jaqen H'ghar
  • 4,305
  • 2
  • 14
  • 26