(一)拦截*.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中同时使用的配置问题的更多相关文章

  1. ssh项目部署到weblogic中问题总结

    部署到weblogic还是比较费劲的 ,不过基本上问题全是由于classloader顺序的问题引起的. 首先在web-inf底下添加weblogic.xml文件如下 <?xml version= ...

  2. 如何对应用服务性能问题诊断(Tomcat、Weblogic中间件)

    在我们web项目中,我们常见的web应用服务器有Tomcat.Weblogic.WebSphere.它们是互联网应用系统的基础架构软件,也叫“中间件”,负责处理动态在页面请求,并为应用提供了名字.事务 ...

  3. weblogic中部署SSH项目遇到的坑

    总结将SSH项目部署到weblogic遇到的坑.项目中是SSH,另外还用到了webservice.quartz等框架.在tomcat部署是可以的,现在总结部署到weblogic遇到的坑. 在这里说一下 ...

  4. weblogic中配置自定义filter和servlet

    情景:最近公司产品要接入其它厂商的单点服务器,本来我是在Tomcat上进行测试,使用的是spring boot 的注解方式@webFilter和@webServlet注解写过滤器和servlet类,启 ...

  5. Tomcat、Weblogic、JBoss、GlassFish、Resin、Websphere弱口令及拿webshell方法总结 [复制链接]

    1.java应用服务器    Java应用服务器主要为应用程序提供运行环境,为组件提供服务.Java 的应用服务器很多,从功能上分为两类:JSP 服务器和 Java EE 服务器.1.1  常见的Se ...

  6. Springboot 1.X 在Weblogic 中的发布

    springboot在tomcat中的兼容性很好,但是如果要把Springboot项目发布在weblogic,尤其是老版本的Weblogic就会出现各种问题.经过本人的不懈努力及查询资料,终于将Spr ...

  7. tomcat和weblogic发布时,jar包内资源文件的读取路径问题

    问题场景: 本地使用的是tomcat作为发布容器,应用启动后一切正常: 发布测试环境服务器使用weblogic作为发布容器,发布后File类读取文件无法找到文件(路径错误). 问题原因: tomcat ...

  8. WebLogic中的一些基本概念

    WebLogic中的一些基本概念   WebLogic 中的基本概念 上周参加了单位组织的WebLogic培训,为了便于自己记忆,培训后,整理梳理了一些WebLogic的资料,会陆续的发出来,下面是一 ...

  9. WebLogic 中的基本概念

    完全引用自: WebLogic 中的基本概念 WebLogic 中的基本概念 上周参加了单位组织的WebLogic培训,为了便于自己记忆,培训后,整理梳理了一些WebLogic的资料,会陆续的发出来, ...

随机推荐

  1. EditPlus不能着色显示SQl语句的问题

    说明:今天重装了系统后,从网上安装下载了一个EditPlus阅读代码,发现sql语句是灰色的,不和以前的带有颜色的看着美观了,顿时心里别扭了起来.以为下错了版本,可是换了好几个,都是这样,网上查了一下 ...

  2. ubuntu安装ftp服务器

    ubuntu安装ftp服务器 1: 安装vsftpd ~$ sudo apt-get install vsftpd ubuntu10.10自己装了,这步省略. 2: 配置vsftpd 2.1 修改vs ...

  3. paip.不同目录结构哈的文件批量比较

    paip.不同目录结构哈的文件批量比较 作者Attilax 艾龙,  EMAIL:1466519819@qq.com 来源:attilax的专栏 地址:http://blog.csdn.net/att ...

  4. OpenGL学习进程(12)第九课:矩阵乘法实现3D变换

    本节是OpenGL学习的第九个课时,下面将详细介绍OpenGL的多种3D变换和如何操作矩阵堆栈.     (1)3D变换: OpenGL中绘制3D世界的空间变换包括:模型变换.视图变换.投影变换和视口 ...

  5. Android兼容包multidex的开发和构建方法

    在Android开发中,函数方法超过65k限制后,我们就常常会用到multidex分包解决,但是multidex的配置,对系统apk的构建.签名.打包复杂性大大的增加,严重的降低了构建效率.那这个问题 ...

  6. 安卓开发, 遇到WebView不能加载静态网页, WebView显示 "net::ERR_PROXY_CONNECTON_FAILED"

    http://blog.csdn.net/zhouchangshi/article/details/44454695 Android开发中遇到网络连接问题, 要找WebView中显示一个静态的网页, ...

  7. android retrofit @Query用法

    http://www.b3a4a.com/?id=71 //https://login.xx.cn/mobile/login?access_token=A7E3D8CC98776F7C16F328B6 ...

  8. 如何在windows7上安装启明星系统。

    启明星系统提供多种安装方式.安装包里自带了setup.exe.每个程序的 install下有在线安装(例如请假应用程序为book,则默认为 http://localhost/book/install ...

  9. GO語言視頻教程下載

    需要的朋友可以加QQ群195112,在群共享內可以下載到.

  10. JavaScript中如何中断forEach循环

    先来看下forEach的实现 // Production steps of ECMA-262, Edition 5, 15.4.4.18// Reference: http://es5.github. ...