Does f:viewParam only pass query string in url when first page uses the same managed bean as the second page?

后端 未结 2 1840
说谎
说谎 2020-12-10 09:21

Let\'s use a search page and a results page for example. If i have a ViewScoped bean that handles my search page and my results page, i\'m able to pass parameters through th

2条回答
  •  离开以前
    2020-12-10 10:15

    includeViewParams works only if both the source and target view have the desired view parameters declared as .

    So, in your parituclar case, you need to put the s with very same name in both the search.xhtml and results.xhtml. Under the covers, the includeViewParams namely only grabs the view params of the current view and then only applies the ones which are also declared in the target view.

    See also:

    • What can , and be used for?

    Unrelated to the concrete problem, you seem to effectively want a GET form. In that case, there is a better way for that than performing a POST-Redirect-GET with parameters. Look at the bottom of the above "See also" link.

提交回复
热议问题