`
gzhw
  • 浏览: 22384 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
最新评论

Facelets step by step

阅读更多
Facelets step by step:
1. Need 3 JAR files in WEB-INF/lib
§ jsf-facelets.jar, el-api.jar, el-ri.jar
 
 
2.In web.mxl
 Extension of faceletsfiles.
E.g., foo.xhtmlwill be accessed as foo.faces.
<web-app></web-app>
<context-param></context-param>
<param-name></param-name> javax.faces.DEFAULT_SUFFIX
<param-value></param-value> .xhtml
How often to check for changes
after initial deployment.
<context-param></context-param>
<param-name></param-name> facelets.REFRESH_PERIOD
<param-value></param-value> 2
Use debug/development output.
<context-param></context-param>
<param-name></param-name> facelets.DEVELOPMENT
<param-value></param-value> true
...
 
 
3. faces-config.xml Setting
<faces-config></faces-config>
<application></application>
<view-handler></view-handler>
com.sun.facelets.FaceletViewHandler
   
...
 
 
4. ? Define template file
¡§ Common data for all pages goes directly in template file
¡§ Sections that will be changed marked with ui:insert
...

 

Content shared by all clients
...
? Define client file(s)
¡§ Specify template file with ui:composition
¡§ Give content for the sections with ui:define
Content to go in "body" section of template
 
 
5. Use xhtml
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
...
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics