JSF

来源:互联网 发布:网络语 编辑:程序博客网 时间:2024/06/10 03:26

What is JSF

A set of web-based GUI controls and handlers
A device-independent GUI control framework
AN MVC-based Web app framework
An Ajax library
is the official java EE library for web apps

JSF & XHTML
JSF adds extra declarations to tag

<html xmlns="http://www.w3.org/1999/xtml" xmlns:h="http://xmlns.jcp.org/jsf/html">

JSF replaces elements with JSF tags
head->h:head
body->h:body
form->h:form
input type=”text”->h:inputText
input type=”submit”  h:commandButton

Designating output value

#{employee.address} //or<h:outputText value="`#{employee.address}"/>

Designating submitted value

<h:inputText value="#{employee.address}"/>

Designating method call after submission

<h:commandButton value="Button Label"                      action="#{employee.processEmployee}"/>
原创粉丝点击