URL Params from action method

Splash Forums PrettyFaces Users URL Params from action method

This topic contains 1 reply, has 2 voices, and was last updated by  Lincoln Baxter III 5 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #27451


    Hello guys,

    i searched a lot, but i haven’t found a solution. How can i append URL parameters to the return of an action method?

    Given an action method like this:

    // Should redirect to /abc?param1=yes
    public String onCommandButton() {
       return "pretty:newDestination";
    // return "pretty:newDestination?param1=yes";


    To do this, you’ll need to create a “mapped query-parameter” in your pretty-config.xml file (or your class configuration if you are using annotations.)


    <url-mapping id="store"> 
       <pattern value="/store/" /> 
       <view-id value="/faces/shop/store.jsf" />
       <query-param name="section"> #{bean.section} </query-param>

    Then you just need to set the value of the bean before navigating to the page:

    public String onCommandButton() {
       return "pretty:store";

    PrettyFaces will extract the parameter value and use it when creating the URL.

    I hope this helps.

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘PrettyFaces Users’ is closed to new topics and replies.

Comments are closed.