How to get value in a textbox from a JSF page to a Java Class?
I already created the bean, and it get开发者_开发百科s the value from the textbox, my problem is how can i pass it to another java class?
Just pass it as method argument the usual Java way. You can do it in the action method.
E.g.
<h:form>
<h:inputText value="#{bean.input}" />
<h:commandButton value="Submit" action="#{bean.submit}" />
</h:form>
with
private String input; // +getter +setter
public void submit() {
YourAnotherClass yourAnotherClass = new YourAnotherClass();
yourAnotherClass.process(input);
}
精彩评论