sitemesh2在tomcat和weblogic中同时使用的配置问题
(一)拦截*.do,装饰器中匹配do
tomcat 可行
weblogic 不可行
web.xml
~~~
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>
com.opensymphony.module.sitemesh.filter.PageFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
~~~
decorators.xml
~~~
<decorators defaultdir="/pages/_decorators">
<excludes>
</excludes>
<decorator name="index" page="indexde.jsp">
<pattern>/index.do*</pattern>
</decorator>
</decorators>
~~~
(二)拦截forward *.jsp,装饰器中匹配jsp
tomcat 可行
weblogic 可行
web.xml
~~~
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>
com.opensymphony.module.sitemesh.filter.PageFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>*.jsp</url-pattern>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
~~~
decorators.xml
~~~
<decorators defaultdir="/pages/_decorators">
<excludes>
</excludes>
<decorator name="index" page="indexde.jsp">
<pattern>/pages/index*</pattern>
</decorator>
</decorators>
~~~
(三)拦截*.do,装饰器中同时匹配do和jsp
tomcat 可行
weblogic 可行
原因:
摘自 http://markmail.org/message/gmurb6e5lnnivnw2#query:+page:1+mid:2z2pgcifcyi7ukag+state:result
A request comes in to a servlet, that servlet forwards to
a JSP page using RequestDispatcher.forward(). Now, in Tomcat, a call to
request.getServletPath() before and after the call to chain.doFilter() returns
the exact same thing, regardless of whether the target servlet executes a
forward. But in WebLogic, the call to getServletPath() after chain.doFilter()
returns the forwarded path, not the original path. So the path matching that
works in Tomcat doesn't work in WL, and vice-versa.
翻译:
一个请求进入servlet,servlet又使用RequestDispatcher.forward()了一个jsp页面。
在tomcat中,chain.doFilter() 前后使用request.getServletPath() 获得的信息是一致的。
在weblogic中,chain.doFilter() 后使用request.getServletPath() 获得的是forward后的地址。
web.xml
~~~
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>
com.opensymphony.module.sitemesh.filter.PageFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
~~~
decorators.xml
~~~
<decorators defaultdir="/pages/_decorators">
<excludes>
</excludes>
<decorator name="index" page="indexde.jsp">
<pattern>/pages/index*</pattern>
<pattern>/index.do*</pattern>
</decorator>
</decorators>
~~~
sitemesh2在tomcat和weblogic中同时使用的配置问题的更多相关文章
- ssh项目部署到weblogic中问题总结
部署到weblogic还是比较费劲的 ,不过基本上问题全是由于classloader顺序的问题引起的. 首先在web-inf底下添加weblogic.xml文件如下 <?xml version= ...
- 如何对应用服务性能问题诊断(Tomcat、Weblogic中间件)
在我们web项目中,我们常见的web应用服务器有Tomcat.Weblogic.WebSphere.它们是互联网应用系统的基础架构软件,也叫“中间件”,负责处理动态在页面请求,并为应用提供了名字.事务 ...
- weblogic中部署SSH项目遇到的坑
总结将SSH项目部署到weblogic遇到的坑.项目中是SSH,另外还用到了webservice.quartz等框架.在tomcat部署是可以的,现在总结部署到weblogic遇到的坑. 在这里说一下 ...
- weblogic中配置自定义filter和servlet
情景:最近公司产品要接入其它厂商的单点服务器,本来我是在Tomcat上进行测试,使用的是spring boot 的注解方式@webFilter和@webServlet注解写过滤器和servlet类,启 ...
- Tomcat、Weblogic、JBoss、GlassFish、Resin、Websphere弱口令及拿webshell方法总结 [复制链接]
1.java应用服务器 Java应用服务器主要为应用程序提供运行环境,为组件提供服务.Java 的应用服务器很多,从功能上分为两类:JSP 服务器和 Java EE 服务器.1.1 常见的Se ...
- Springboot 1.X 在Weblogic 中的发布
springboot在tomcat中的兼容性很好,但是如果要把Springboot项目发布在weblogic,尤其是老版本的Weblogic就会出现各种问题.经过本人的不懈努力及查询资料,终于将Spr ...
- tomcat和weblogic发布时,jar包内资源文件的读取路径问题
问题场景: 本地使用的是tomcat作为发布容器,应用启动后一切正常: 发布测试环境服务器使用weblogic作为发布容器,发布后File类读取文件无法找到文件(路径错误). 问题原因: tomcat ...
- WebLogic中的一些基本概念
WebLogic中的一些基本概念 WebLogic 中的基本概念 上周参加了单位组织的WebLogic培训,为了便于自己记忆,培训后,整理梳理了一些WebLogic的资料,会陆续的发出来,下面是一 ...
- WebLogic 中的基本概念
完全引用自: WebLogic 中的基本概念 WebLogic 中的基本概念 上周参加了单位组织的WebLogic培训,为了便于自己记忆,培训后,整理梳理了一些WebLogic的资料,会陆续的发出来, ...
随机推荐
- mysql where执行顺序
where执行顺序是从左往右执行的,在数据量小的时候不用考虑,但数据量多的时候要考虑条件的先后顺序,此时应遵守一个原则:排除越多的条件放在第一个. 在用MySQL查询数据库的时候,连接了很多个过滤条件 ...
- ios 常用第三方库要加的framework,ARC的设置
一,常用第三方库要加的framework 1,SQLite3数据库:FMDatabase 需要添加:libsqlite3.dylib 2,网络请求:ASIHTTPRequest 需要添加:CFNetw ...
- atitit.组件化事件化的编程模型--服务端控件(1)---------服务端控件与标签的关系
atitit.组件化事件化的编程模型--服务端控件(1)---------服务端控件与标签的关系 1. 服务器控件是可被服务器理解的标签.有三种类型的服务器控件: 1 1.1. HTML 服务器控件 ...
- Spring之@Configuration配置解析
1.简单的示例: @Configuration @EnableConfigurationProperties({DemoProperties.class}) public class DemoConf ...
- bzoj 1207: [HNOI2004]打鼹鼠
1207: [HNOI2004]打鼹鼠 Time Limit: 10 Sec Memory Limit: 162 MB Description 鼹鼠是一种很喜欢挖洞的动物,但每过一定的时间,它还是喜 ...
- NEWS - InstallShield 2014正式发布
InstallShield又迎来了新的版本InstallShield 2014,开发版本号Ver 21.0,相关产品信息已经可以从厂商Flexera Software(富莱睿)官方网站获得. 对于中国 ...
- DRAM 内存介绍(二)
参考资料:http://www.anandtech.com/show/3851/everything-you-always-wanted-to-know-about-sdram-memory-but- ...
- zz c++ Useful resources
Useful resources < cpp The Standard C++ Foundation - Non-profit hub for C++ news, articles, and e ...
- easy datagrid 按钮控制
onBeforeLoad : function() {// 这里是紧接着你的修改按钮的 // 注意ID为你初始化工具栏按钮对应的ID var adminid=<%=Admin_Id%>+' ...
- 奇怪吸引子---Russler
奇怪吸引子是混沌学的重要组成理论,用于演化过程的终极状态,具有如下特征:终极性.稳定性.吸引性.吸引子是一个数学概念,描写运动的收敛类型.它是指这样的一个集合,当时间趋于无穷大时,在任何一个有界集上出 ...