backing beans in different jar

Splash Forums PrettyFaces Users backing beans in different jar

This topic contains 1 reply, has 2 voices, and was last updated by  Christian Kaltepoth 2 years, 11 months ago.

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

    rammer
    Participant

    Hi,

    I will try to explain this the best I can:

    I have my project deployed in JBoss EAP 6.1 in a WAR folder. In the WEB-INF file, in the WAR folder, I have a lib folder which contains all my libraries, in this file is a jar that contains backing beans that I need to access with prettyfaces annotations inside.

    So… my XHTML files live in the WAR file root directory but the backing beans which use prettyfaces for the url-rewriting live in the jar file in the lib directory. It seems like when I do a return pretty:somexhtmlpage in my navigation backing bean prettyfaces can not find the correct backing beans which lives in the jar file in my lib directory. Is there something I am doing wrong? Can this actually be done? If I move all those backing beans out of the jar and into the war everything works normally, however that really isn’t an option. Do you have any ideas? Can you explain to me how Prettyfaces gathers all the annotations in the backing beans and does the URL-rewriting?

    I hope I have explained this well enough.

    Thanks you very much for your time.

    Kevin

    #24738

    Hey Kevin,

    you have to tell PrettyFaces, that it should also scan the lib folder of your WAR archive for annotations. This isn’t done by default for performance reasons. Setting this parameter in your web.xml should do the trick:

    
    <context-param>
       <param-name>com.ocpsoft.pretty.SCAN_LIB_DIRECTORY</param-name>
       <param-value>true</param-value>
    </context-param>
    

    See:

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

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

You must be logged in to reply to this topic.

Comments are closed.