View parameter when navigating to another page

前端 未结 2 1773
独厮守ぢ
独厮守ぢ 2020-12-22 09:49

I am using JSF2, and I need to be able to pass a parameter from one JSF page to another via a commandLink.

I am on page funding.xhtml (ViewScoped) and h

2条回答
  •  清酒与你
    2020-12-22 10:15

    I don't know the specifics of the methods you tried to achieve your goal and hence we cant tell what was wrong with them, but if we consider your code 'as is' you don't have anything that will pass the string you want.

    Not to repeat ourselves, there are plenty of answers here dedicated to using this or that method, so I will give you the best references, in my opinion, of course.

    1. How can I pass a parameter to a commandlink inside a datatable;
    2. ViewParam vs @ManagedProperty;
    3. What can and be used for.

    Regarding the usage of back buttons in JSF you could also take a look at my own answer on How to get back to the same page in JSF.

    By the way, using POST for page-to-page navigation is considered to be a bad practice. If all you need is to navigate to another page you'd better use plain or instead.

提交回复
热议问题