(一)拦截*.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. javascript 日常总结

    1. 将彻底屏蔽鼠标右键 oncontextmenu=”window.event.returnValue=false” < table border oncontextmenu=return(f ...

  2. beego中orm关联查询使用解析

    这两天在学习beego框架,之前学习的时候遗漏了很多东西,比如orm.缓存.应用监控.模板处理等,这里将通过实例记录下如何使用beego自带的orm进行关联查询操作. 首先说明下,beego的orm有 ...

  3. Command模式

    Command模式只是封装了一个没有任何变量的函数. interface Command{ void Excute();} 具有强烈的分解功能的味道.把函数层面的任务提升到了类的层面(一个类仅仅是为了 ...

  4. WindowsPhone8拍照功能实现简介

    WindowsPhone作为一款智能手机操作系统,支持APP中拍照是必不可少的,目前在WP8上的拍照主要有以下三种途径: 1.使用CameraCaptureTask: 2.使用PhotoCamera类 ...

  5. WindowsPhone App如何扩展能够使用的内存

    目前手机系统中对App的内存使用都是有限制的,尤其是对于Android和WindowsPhone这样的平台,因为机型很多,配置高低不同因此对于同一个App在不同的手机上运行的效果也不同. WP上通常对 ...

  6. HtmlDocument

    HtmlDocument HtmlDocument类对应着一个HTML文档代码.它提供了创建文档,装载文档,修改文档等等一系列功能,来看看它提供的功能. 一.属性 int CheckSum { get ...

  7. Java Socket网络编程常见异常(转)

    1.java.net.SocketTimeoutException 这个异常比较常见,socket超时.一般有2个地方会抛出这个,一个是connect的时候,这个超时参数由connect(Socket ...

  8. 我所理解的JavaScript闭包

    目录 一.闭包(Closure) 1.1.什么是闭包? 1.2.为什么要用闭包(作用)? 1.2.1.保护函数内的变量安全. 1.2.2.通过访问外部变量,一个闭包可以暂时保存这些变量的上下文环境,当 ...

  9. STM32 USB CAN 学习笔记 - 共享RAM的用法

    USB 时钟可以一直使能. 如果CAN时钟没有使能,RAM 能被软件读写.(CANBus 不能发送和接受Message) 如果CAN时钟使能,RAM不能软件被写. CANBus Core 控制此RAM ...

  10. IOS适配

    • Default.png(图片尺寸为320x480):显示在非Retina-3.5英寸屏幕上(iPhone3G\iPhone3GS,屏幕分辨率为320x480) • Default@2x.png(图 ...