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 1 year, 6 months ago.

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

    stc
    Participant

    Hello, i try something like :

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

    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 1 year, 6 months ago by  stc.
    #26807

    Hi,

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

    Thanks,
    Lincoln

    #26808

    stc
    Participant

    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.

    #26810

    stc
    Participant

    May i use JSF 2.0 ?

    #26811

    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?

    #26814

    See my answer on your question on stackoverflow:

    http://stackoverflow.com/a/28250690/395181

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

    #26823

    stc
    Participant

    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.

    #26826

    @PostConstruct is also too early. 😉 Try an URL action..

    #26854

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

    http://www.ocpsoft.org/prettyfaces/#section-4

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

You must be logged in to reply to this topic.

Comments are closed.