How can I get "nice" URL from JSF outcome programatically?

Splash Forums Rewrite Users How can I get "nice" URL from JSF outcome programatically?

Tagged: 

This topic contains 2 replies, has 3 voices, and was last updated by  Lincoln Baxter III 5 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18656

    pavel.arnost
    Participant

    Hi,

    how can I get “nice” URL from JSF outcome? For example I have “user?id=10” outcome and Join.path(“/user/{id}”).to(“/user.html”) rule and I would like to get “/user/10” URL in code where I generate email message.

    Thanks,

    Regards

    Pavel

    #22865

    Interesting question.

    @lincoln: What’s the recommended way to do this in Rewrite? Is there any public API for this?

    #22866

    FacesContext.getCurrentInstance().getExternalContext().encodeURL("/user.html?id=10");

    or…

    ((ConfigurableNavigationHandler) FacesContext.getCurrentInstance().getApplication().getNavigationHandler()).getNavigationCase(context, fromAction, outcome).getRedirectURL(facesContext)

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

You must be logged in to reply to this topic.

Comments are closed.