Navigation in JavaServer Faces, redirect with correct parameters

I have a page: http://mypage.com/items.jsf .

This page takes the following for granted:

  • The identifier is set using GET or the ID is set by POST.

Now can I manually call items.jsf? ID = 10

But what I really want to do is a button that calls a function that returns the navigation URL.

public String test()
{
    return "10";
}

Now, having the following code in the JSF file .

    <h:form>
        <h:commandButton action="#{itemsBean.test}" value="Redirect me" />
    </h:form>

What I want is that when I click Redirect Me, I want the navigation rule to know that I want to go to: items.jsf? ID = 10

Is it possible? This seems to be a really trivial problem.

0
2

JSF Facelets . JSF 1.2 URL- .

spring:

+1

JSF1.2, < h: outputLink > < f: param name= "value =" " > . OutputLink :? Name = value

, jsut , , PrettyFaces - SEO, , JSF/JSF2

JSF.

+1

Source: https://habr.com/ru/post/1724173/


All Articles