私のpage1.xhtmlで
<h:form>
<h:inputText value="#{page_one.name}" />
<h:commandButton action="#{page_one.onSubmit}" value="Submit" />
</h:form>
PageOneBean.class
@ManagedBean(name="page_one")
@RequestScoped
public class PageOneBean {
private String name;
public String onSubmit(){
return "/page2.xhtml";
}
}
page2.xhtml
<h:form>
<h:commandButton action="#{page_two.onSubmit}" value="Submit" />
</h:form>
PageTwoBean.class
@ManagedBean(name = "page_two")
@RequestScoped
public class PageTwoBean {
private String name;
public String onSubmit() {
System.out.println("name" + name);
return null;
}
}
page_two.onSubmit ボタンをクリックしたときに pageTwoBean で pageOneBean.name を取得するにはどうすればよいですか?