English 中文(简体)
如何在从Java级联合基金网页到Java级的文本箱中获取价值?
原标题:How to get value in a textbox from a JSF page to a Java Class?
  • 时间:2011-09-24 15:33:59
  •  标签:
  • jsf-2

我已经造就了信条,从文字箱中获得了价值,我的问题是,如何把它传给另一个 j子。

最佳回答

只是将它作为方法论断通常的 Java路。 你们可以在行动方法中这样做。

E.g.

<h:form>
    <h:inputText value="#{bean.input}" />
    <h:commandButton value="Submit" action="#{bean.submit}" />
</h:form>

iii

private String input; // +getter +setter

public void submit() {
    YourAnotherClass yourAnotherClass = new YourAnotherClass();
    yourAnotherClass.process(input);
}
问题回答

暂无回答




相关问题
JSF redirect doesn t work

I have a problem with redirecting a page in my JSF application. My navigation rule look like this : <navigation-rule> <from-view-id>/index.xhtml</from-view-id> <...

Get JSF managed bean by name in any Servlet related class

I m trying to write a custom servlet (for AJAX/JSON) in which I would like to reference my @ManagedBeans by name. I m hoping to map: http://host/app/myBean/myProperty to: @ManagedBean(name="myBean"...

JSF2 - what scope for f:ajax elements?

I have this form: <h:form> <h:outputText value="Tag:" /> <h:inputText value="#{entryRecorder.tag}"> <f:ajax render="category" /> </h:inputText> ...

Modifying JSF Component Tree in PhaseListener

I m having an issue. I ve implemented a PhaseListener, which is meant to add a style class to any UIInput components in the tree that have messages attached to them, and removes the style class if it ...

JSF 2 - clearing component attributes on page load?

The real question: Is there a way to clear certain attributes for all components on an initial page load? Background info: In my application, I have a JSF 2.0 frontend layer that speaks to a service ...

JSF2 - backed by EJB or ManagedBean?

As I am learning JSF2, I realized I am not sure what the backing components should be. From design point of view, what is the difference between EJBs and @ManagedBeans? In the end I am going to use ...

热门标签