url pattern for view individuals users.

Splash Forums PrettyFaces Users url pattern for view individuals users.

This topic contains 2 replies, has 2 voices, and was last updated by  lofainc 9 years, 12 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #18144


    Actually I have a list of users(dataTable with a link on userId). On clicking userId redirect to view page.I need page for viewing users with url pattern, http://localhost:8080/user/view/1 for first user and http://localhost:8080/user/view/2 for the second etc.How can I achieve this with prettyfaces? How to process this userId ,say 1,2 etc in the backing bean.Can anybody explain?

    `<url-mapping id=”view”>

    <pattern value=”/user/view/#{bean.userId}/” />

    <view-id value=”/userview.jsf” />


    So how can I get this userId inside my bean?

    I am using JSF2+Primefaces.3.0.M3+Prettyfaces-jsf2.3.3.2 with GAE.


    The code you posted is already a good example. In this case the userid will be injected into #{bean.userId}. So you don’t have to “get” the value from anywhere. You just have to tell PrettyFaces where it should be stored. :)

    See this chapter in the documentation:


    The next step would be to add a page action that get’s executed whenever this URL is accessed. This method could then use the injected ID to load the user from the database.

    See this chapter for details on page actions:


    I hope this helps :)



    Thanks.. I got that.

Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘PrettyFaces Users’ is closed to new topics and replies.

Comments are closed.