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的资料,会陆续的发出来, ...
随机推荐
- AngularJS快速入门指南08:表格
ng-repeat指令非常适合用来显示表格. 在表格中显示数据 在AngularJS中显示表格非常容易: <div ng-app="myApp" ng-controller= ...
- little skill---ping
一.ping简介 Ping是Windows下的一个命令,在Unix和Linux下也有这个命令. ping也属于一个通信协议,是TCP/IP协议的一部分. 利用“ping”命令可以检查网络是否连通,可以 ...
- js获取url中的参数,url中传递中文的时候通过js解码的方式
如果传递的参数是: <a href="${pageContext.request.contextPath}/productdisplay/productDisplay_productD ...
- paip.sqlite 管理最好的工具 SQLite Expert 最佳实践总结
paip.sqlite 管理最好的工具 SQLite Expert 最佳实践总结 一般的管理工具斗可以...就是要是sqlite没正常地关闭哈,有shm跟wal文件..例如ff的place.sqlit ...
- Java面向对象概述
一.什么是面向对象? 现实世界中,随处可见的一种事物就是对象,对象是事物存在的实体,如人类.书桌.计算机.高楼大厦等.人类解决问题的方式总是将复杂的事物简单化,于是就会思考这些对象都是由哪些部分组成的 ...
- iOS应用性能调优的25个建议和技巧
本文来自iOS Tutorial Team 的 Marcelo Fabri,他是Movile的一名 iOS 程序员.这是他的个人网站:http://www.marcelofabri.com/,你还可以 ...
- python web框架——初识tornado
一 Tornado概述 Tornado是FriendFeed使用的可扩展的非阻塞式web框架及其相关工具的开源版本.这个Web框架看起来有些像web.py或者Google的 webapp,不过为了能有 ...
- time
http://blog.csdn.net/JGood/archive/2010/04/07/5457284.aspx Python提供了多个内置模块用于操作日期时间,像calendar,time ...
- android: SQLite创建数据库
SQLite 是一款轻量级的关系型数据库,它的运算速度非常快, 占用资源很少,通常只需要几百 K 的内存就足够了,因而特别适合在移动设备上使用.SQLite 不仅支持标准的 SQL 语法,还遵循了数据 ...
- [MS bug]安装SQL Server 2008 错误:is not a valid login or you do not have permission
环境: Windows 7 sp1 x64. 问题描述: 安装到几乎要完成的时候爆出:is not a valid login or you do not have permission.安装失败. ...