(一)拦截*.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. [数据库]SQL中Group By 的常见使用方法.

    前言今天逛java吧看到了一个面试题, 于是有了今天这个文章, 回顾下Group By的用法.题目如下:Select name from table group by name having coun ...

  2. celery与mangodb搭配应用

    写作背景介绍 在celery简单应用中已经介绍了如何去配置一个celery应用,也知道怎么分离任务逻辑代码与客户端代码了.我们现在的任务是怎么把计算结果保存到数据库中,这种数据持久化是非常重要的.你一 ...

  3. Linux操作系统shell与函数详解

    shell和函数的定义 1. linux  shell 函数 将一组命令集或语句形成一个可用的块, 这些语句块称为函数. 2. shell  函数的组成 函数名:函数名字,注意一个脚本中函数名要唯一, ...

  4. hive函数总结

    转自:http://www.cnblogs.com/end/archive/2012/06/18/2553682.html 1.内置运算符1.1关系运算符 运算符 类型 说明 A = B 所有原始类型 ...

  5. RTL8710 ROM 符号表 函数,常量,变量

    函数 Name Address Ordinal ---- ------- ------- __vectors_table Reset_Handler NMI_Handler HardFault_Han ...

  6. Windows7下面exe寄宿WCF:Http无法注册URL{0} ,进程不具有此命名空间的访问权限问题

    运行寄宿exe程序的时候通过run as administrator来启动就OK了.

  7. CoreOS实践(1)—CoreOS初体验

    CoreOS主要包含以下一些东西: (1)最小的OS:kernel+systemd (2)使用Docker运行应用 (3)使用fleet管理集群 (4)使用etcd实现服务发现:一个分布式的K/V存储 ...

  8. Scala 深入浅出实战经典 第63讲:Scala中隐式类代码实战详解

    王家林亲授<DT大数据梦工厂>大数据实战视频 Scala 深入浅出实战经典(1-87讲)完整视频.PPT.代码下载:百度云盘:http://pan.baidu.com/s/1c0noOt6 ...

  9. python数据结构之栈、队列的实现

    这个在官网中list支持,有实现. 补充一下栈,队列的特性: 1.栈(stacks)是一种只能通过访问其一端来实现数据存储与检索的线性数据结构,具有后进先出(last in first out,LIF ...

  10. Ubuntu server 搭建Git server

    Ubuntu server 搭建Git server,git相比svn,最主要就是分布式了,每个客户端用户的本地都是一个版本管理控制器. Ubuntu server 版本为12.04 搭建步骤如下: ...