Results 1 to 2 of 2
  1. #1
    vector_ever is offline Senior Member
    Join Date
    Jul 2013
    Rep Power

    Default Change the URL to be dynamic (pass parameters to the URL)


    I need to make some changes on the URL
    I have JSF page which has set of names (human names) like this

    John Adam
    Nikolas Teller
    David newman
    Mac Rayan

    each of those names is link, by clicking on it will lead me to another JSF page which will display more information about this person (like email, phone number , address, ect...), but the URL will be some think like that
    http://localhost:8080/building/details It will be the same URL for every person

    Any way that URL not good what i need is changing it to have some parameters related to the chosen name (like first name, last name or id) to be some thing like this:
    http://localhost:8080/building/stuff/3 (where 3 is the id of the person) or
    http://localhost:8080/building/stuff/Adam (Adam is the last name of the selected person) or even some thing like this

    How to do it?
    Last edited by vector_ever; 07-07-2014 at 03:47 PM.

  2. #2
    Join Date
    Apr 2014
    Rep Power

    Default Re: Change the URL to be dynamic (pass parameters to the URL)

    You can do something like below in jsf 2

    <ui:repeat value="#{personBean.personList}" var="person">
    <h:commandLink action="#{personBean.getPersonDetails(person.perso nId)}" value="#{person.personName}"/>

    getPersonDetails(person.personId) is the action in the

    Now clicking on the action it will fetch the person details using the personId and you can use ajax to show the result in the same page or you can open a popup to show the result.

Similar Threads

  1. Replies: 12
    Last Post: 04-20-2012, 06:43 PM
  2. Replies: 1
    Last Post: 04-17-2011, 04:59 PM
  3. Dynamic for loop
    By vikrambatra1709 in forum Advanced Java
    Replies: 3
    Last Post: 02-08-2010, 09:11 AM
  4. Dynamic GUI
    By ike2u in forum New To Java
    Replies: 4
    Last Post: 08-08-2009, 03:50 AM
  5. Dynamic DecimalFormatter
    By felixtfelix in forum New To Java
    Replies: 0
    Last Post: 03-17-2008, 05:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts