I don't reach to inject a managed bean attribute

Splash Forums PrettyFaces Users I don't reach to inject a managed bean attribute

This topic contains 8 replies, has 3 voices, and was last updated by  Lincoln Baxter III 6 years, 11 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • #26805


    Hello, i try something like :

        <url-mapping id="inscription1">
            <pattern value="/inscription-#{/[1]/registerManagedBean.actionStr}.html" />
            <view-id value="/WEB-INF/base/register.xhtml" />

    In my registerManagedBean actionStr has a null value, but in my view (register.xhtml) #{registerManagerBean.actionStr} displays the good value (1).
    I don’t know how to get the value in my ManagedBean
    thank you for helping.

    • This topic was modified 7 years ago by  stc.


    What type of ManagedBean is it? SessionScoped? ConversationScoped? Which container? JSF? CDI? Spring? EJB?




    thanks for your answer, i use JSF 2.2 with primefaces 5.0, it’s not maven, i use a viewScoped managed-bean and i’ve also try to meke it requestScoped.



    May i use JSF 2.0 ?


    Yes, we support all JSF versions except for 1.1 and prior. ViewScoped beans may cause some issues. Try with RequestScoped first!

    Also, which version of PrettyFaces are you using?


    See my answer on your question on stackoverflow:


    You cannot access the injected value in the constructur, because the value is injected AFTER the constructor is called.



    Thank you for your answers, i use version 3.3.3 (not maven with the prettyfaces-jsf2-3.3.3.jar , i don’t know if a more recent version exists).
    Indeed my application doesn’t run correctly with Application, Session or ViewScoped, i must change all my managed beans with Request Scoped.
    For injecting, i try also to access the value after the constructor (in a @PostConstruct method) but without success, i can only access it in my jsf view.


    @PostConstruct is also too early. πŸ˜‰ Try an URL action..


    The latest version of Rewrite, with the PrettyFaces config extension, is 2.0.12.Final as documented here:


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

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

Comments are closed.