0

i am trying to pass a parameter from a jsf page to another but the problem that the another page i am calling to doesn't change even the URl and it just add "#" to the existing url . this is index.xhtml

        <h:commandLink value="details" action="#{ideeBean.details()}">
                  <f:param name="idee" value="in" />
              </h:commandLink>

this is IdeeBean.java

 public String details(){

      return "details";
  }

and when i click the commandlink the url pass from :http://localhost:8080/gidee/ to http://localhost:8080/gidee/# .

Yuri Amel
  • 29
  • 1
  • 6
  • You need `h:outputLink` to use `f:param` parameters, or `h:commandLink action="#{ideeBean.details(yourParameterValue1, yourParameterValue2)}"` to pass parameters to your action method. – Jasper de Vries Mar 27 '17 at 10:31
  • i want to pass to the url http://localhost:8080/gidee/details.xhtml so the method details() in index.xhtml is correct ? because it pass to http://localhost:8080/gidee/# . – Yuri Amel Mar 27 '17 at 10:37

1 Answers1

0

In order to change the url you need to do a redirect after the action completes.

OTM
  • 656
  • 5
  • 8
  • redirect you mean i should use return "details?faces-redirect=true" in the details method ? i try this too but nothing changes – Yuri Amel Mar 27 '17 at 11:07
  • Yes, either the mapping of outcome "details"should be "details.xhtml" in faces-config or the action method should return details.xhtml?faces-redirect=true. – OTM Mar 27 '17 at 11:28