日期:2014-05-16 浏览次数:20369 次
JSF 1.x
??? * Java EE 标准 (JSR 127, 252)
??? * 面向组件的 web框架
??? * 扩展性较好
??? * 有很多厂商工具支持
JSF 2.0
??? * Java EE 6 (JSR 314)的一部分
??? * 减少XML配置
??? * 更好的错误处理机制
??? * Ajax支持
??? * GET请求支持
??? * 更容易开发component
??? * 增加资源resource处理机制
?
<h:commandButton value="Press me!" action="next"/> <navigation-rule> <navigation-case> <from-outcome>next</from-outcome> <to-view-id>/next.jsp</to-view-id> </navigation-case> </navigation-rule>?
<h:commandButton value="Press me!" action="next"/> //自动对应到页面了
<h:inputText value="#{login.name}"/>?
<managed-bean> <managed-bean-name>login</managed-bean> <managed-bean-class>com.corejsf.Login</managed-bean> <managed-bean-scope>session</managed-bean-scope> </managed-bean>?
@ManagedBean @SessionScoped public class Login { ... }
? <f:metadata> <f:viewParam name="q" value="#{quizBean.currentProblem}" /> <f:viewParam name="score" value="#{quizBean.score}" /> </f:metadata> ... <h:link outcome="#{quizBean.skipOutcome}" value="Skip" includeViewParams="true"> <f:param name="q" value="#{quizBean.currentProblem + 1}" /> </h:link>?
<composite:interface> <composite:actionSource name="form:loginAction"/> ... </composite:interface> <composite:implementation> <h:form...> ... <h:commandButton id="loginAction" value="Login" action="welcome"/> </h:form> </composite:implementation>?
<h:commandButton value="Update"> <f:ajax execute="input1 input2" render="output1"/> </h:commandButton>???