Passing parameters between managed beans with request scope

16,583

Use <f:param> in the command link/button and use @ManagedProperty or <f:viewParam> in the target bean or view.

E.g.

<h:commandButton value="Submit" action="#{otherBean.submit}">
    <f:param name="foo" value="#{oneBean.foo}" />
</h:commandButton>

with in OtherBean

@ManagedProperty("#{param.foo}")
private String foo;

// ...
Share:
16,583
Achraf
Author by

Achraf

A beginner software engineer specially in JAVA enterprise edition and some frameworks like hibernate, JSF, Spring...

Updated on June 15, 2022

Comments

  • Achraf
    Achraf almost 2 years

    Im working on a web application using JSF2. I want to pass parameters from a managed bean in backing bean action and I want to retrive the same parametrs in an other managed bean the both with a request scope.

    Thanks in advance.