首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

sitemesh装点页面

2012-11-09 
sitemesh装饰页面步骤:1,引入sitemesh的jar包2,引入struts2对sitemesh的支持包:struts2-sitemesh-plugin-x

sitemesh装饰页面

步骤:

1,引入sitemesh的jar包

2,引入struts2对sitemesh的支持包:struts2-sitemesh-plugin-x.x.x.jar

3,修改web.xml文件,添加ActionContextCleanup和sitemesh过滤器

<filter><filter-name>struts-cleanup</filter-name><filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class></filter><filter><filter-name>sitemesh</filter-name><filter-class>org.apache.struts2.sitemesh.FreeMarkerPageFilter</filter-class></filter><filter-mapping><filter-name>struts-cleanup</filter-name><url-pattern>/*</url-pattern></filter-mapping><filter-mapping><filter-name>sitemesh</filter-name><url-pattern>/*</url-pattern></filter-mapping>

4,提供decorators.xml配置文件,在这个配置文件中定义装饰器的路径,需要放到WEB-INF目录下

5,创建装饰器

6,使用装饰器

????? -->在头部添加一条语句:<meta name="decorator" content="navigation">

热点排行