Question

I use the configuration file pretty-config.xml to rewrite urls:

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



    <url-mapping id="connect_ss">
        <pattern value="/sicav_security" />
        <view-id value="/AuthentificationSS.jsf" />
    </url-mapping>
    <url-mapping id="connect_oblig">
        <pattern value="/sicav_oblig" />
        <view-id value="/AuthentificationCAPOBLIG.jsf" />
    </url-mapping>
</pretty-config>

Can I replace it with annotations?

Was it helpful?

Solution

If I understand your question correctly, you are asking whether it is possible to configure PrettyFaces using annotations.

Yes, that is possible. You can simply use @UrlMapping for that:

@URLMapping(id="connect_ss", pattern="/sicav_security", 
       viewId="/AuthentificationSS.jsf")
public class SomeBean {
  /* Your code */ 
}

Have a look at this part of the official documentation for details:

http://ocpsoft.org/docs/prettyfaces/3.3.3/en-US/html/Configuration.html#config.annotations

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top