Generate pretty link inside java code

Splash Forums PrettyFaces Users Generate pretty link inside java code

This topic contains 3 replies, has 2 voices, and was last updated by  Christian Kaltepoth 10 years, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #18057



    Is it possible to generate pretty link with path parameters inside java code (not on jsf page)?



    But I want use it in backing bean.


    Hey m1m,

    please don’t change your question by editing your old one because people may get confused by this. Just post a reply to clarify your question.

    Regarding your question. Yes, you can create URLs in Java code. There is a class called PrettyURLBuilder that can be used. See this example:

    PrettyConfig config = PrettyContext.getCurrentInstance().getConfig();
    UrlMapping mapping = config.getMappingById("myMapping");
    PrettyURLBuilder builder = new PrettyURLBuilder();
    String url =, true, new Object[] { "somePathParameter "});

    I hope this helps! :)

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

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

Comments are closed.