Is URL friendly with JSF, Facelets and Bootstrap possible?

Asked

Viewed 945 times

0

I am using in a JSF project with Facelets and Bootstrap. How to make it URL friendly?

Example: After logging in the URL looks like this: example.com/public/home.xhtml When you click on a menu item the URL changes to: example.com/public/cadastro.xhtml

It is possible to leave the URL fixed, such as: example with.?

1 answer

4


With Prettyfaces you can do it, link here.

Example of configuration given by the site:

<pretty-config xmlns="http://ocpsoft.org/schema/rewrite-config-prettyfaces" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://ocpsoft.org/schema/rewrite-config-prettyfaces
                      http://ocpsoft.org/xml/ns/prettyfaces/rewrite-config-prettyfaces.xsd">

    <url-mapping id="login">
        <pattern value="/login" />
        <view-id value="/legacy/user/login.jsp" />
    </url-mapping>

</pretty-config>
  • That’s what I wanted! Although I still can’t make it work.

  • 1

    I also had a hard time implementing at first, but there are some tutorials on the Internet that gives to have a better notion.

  • Also I could not make Pretty faces work here. Can anyone then indicate a tutorial that explains better? this basic configuration of the Pretty faces website has no effect

Browser other questions tagged

You are not signed in. Login or sign up in order to post.