弄死人了 这个sitemesh老是出问题 有时候装饰不上 有时候用了struts2的标签格式就会变化 前久师兄用dojo做了棵树经过sitemesh装饰就出不来了 去掉又可以 百度 google了好久都没效果 也没什么效果 不停的试验 不停的试验似乎终于可以了
下面是web.xml中的配置
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/classes/applicationContext.xml
</param-value>
</context-param>
<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>
com.opensymphony.module.sitemesh.filter.PageFilter
</filter-class>
</filter>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</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>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
主要问题似乎就出在sitemesh的dispatcher和struts的dispatcher了 总之这样设置后可以了 也不知道还会出啥问题不
学这些东西感觉资料也找不到好的 都是东一点西一点 还有的错误的 官网的也不详细……真麻烦 对了 工程中还加了个struts对sitemesh支持的jar包……struts2-sitemesh-plugin-2.0.11.jar
分享到:
相关推荐
struts2sitemesh-freemarker 源码
Struts 2.0提供一个Sitemesh插件,允许在Sitemesh模板中使用Struts标记。 要使用Sitemesh需要包含Freemark,Sitemesh和Sitemesh插件库文件。 配置过滤器 如果需要使用Freemark模板文件作为装饰器文件,需要在web....
struts2-sitemesh-plugin-2.0.8.jar
struts2-sitemesh-plugin-2.2.1.1.jarstruts2
struts2-sitemesh-plugin-2.1.6.jar
struts2-sitemesh_入门收集struts2-sitemesh_入门收集
struts2+sitemesh例子 该例子描述了struts2+sitemesh的配置,比较实用
SiteMesh 开发jar包 Struts2 SiteMesh 插件 jar包
一个Struts2+Spring2.5+SiteMesh的小DEMO,仅供大家做个参考!我也刚学会。欢迎大家多交流!
NULL 博文链接:https://takeme.iteye.com/blog/1716488
struts框架与sitemesh框架整合的插件,在java web开发中可以制作模板页,使自己做的网站看起来更专业
struts2与sitemesh整合所需的两个最新架包sitemesh-2.4.2,struts2-sitemesh-plugin-2.1.8
struts2-sitemesh-plugin-2.1.8.1.jar
解决 java.lang.NoSuchFieldException: DEFAULT_PARAM>问题,下载后替换即可。
Sitemesh是由一个基于Web页面布局、装饰以及与现存Web应用整合的框架。它能帮助我们在由大 量页面构成的项目中创建一致的页面布局和外观,如一致的导航条,一致的banner,一致的版权,等等。... struts2 就不用说了撒
包含struts2-core-2.5.10.1.jar,struts2-jfreechart-...struts2-sitemesh-plugin-2.5.10.1.jar,struts2-spring-plugin-2.5.10.1.jar,struts2-testng-plugin-2.5.10.1.jarstruts2-tiles-plugin-2.5.10.1.jar等jar包
struts2-config-browser-plugin-2.3.24.jar, ...struts2-sitemesh-plugin-2.3.24.jar, struts2-spring-plugin-2.3.24.jar, struts2-struts1-plugin-2.3.24.jar, struts2-tiles-plugin-2.3.24.jar,
Struts2.0 与 sitemesh的例子 博文链接:https://jiangyou001.iteye.com/blog/183698