myfaces

http://fanyi.myyoudao.com/WebpageTranslate?keyfrom=webfanyi.top&url=http://myfaces.apache.org/jsfintro.html&type=EN2ZH_CN

定义路由规则

<navigation-rule>
    <from-view-id>/page1.jspfrom-view-id>
    <navigation-case>
        <from-outcome>successfrom-outcome>
        <to-view-id>/page2.jspto-view-id>
    navigation-case>
navigation-rule>

定义bean

<managed-bean>
    <managed-bean-name>sayHelloPagemanaged-bean-name>
    <managed-bean-class>demo.SayHelloPagemanaged-bean-class>
    <managed-bean-scope>requestmanaged-bean-scope>
managed-bean>

定义事件绑定规则

<f:view>
    <h:form id="mainForm">
        <h:outputLabel for="enterName" value="Enter Name"/>
        <h:inputText id="enterName" value="#{sayHelloPage.name}"/>
        <h:commandButton value="Say Hello" action="#{sayHelloPage.sayHello}"/>
    h:form>
f:view>

你可能感兴趣的:(myfaces框架)