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中同时使用的配置问题,布布扣,bubuko.com

时间: 2024-07-30 13:42:57

sitemesh2在tomcat和weblogic中同时使用的配置问题的相关文章

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

1.java应用服务器    Java应用服务器主要为应用程序提供运行环境,为组件提供服务.Java 的应用服务器很多,从功能上分为两类:JSP 服务器和 Java EE 服务器.1.1  常见的Server概述    常见的Java服务器:Tomcat.Weblogic.JBoss.GlassFish.Jetty.Resin.IBM Websphere.Bejy Tiger.Geronimo.Jonas.Jrun.Orion.TongWeb.BES Application Server.Col

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

在我们web项目中,我们常见的web应用服务器有Tomcat.Weblogic.WebSphere.它们是互联网应用系统的基础架构软件,也叫"中间件",负责处理动态在页面请求,并为应用提供了名字.事务.安全.消息.数据访问等,此外,它们还是提供应该构建的开发.部署.运行及管理功能. 当我们对项目做性能测试时,我们如何更好地监控它们,并诊断出性能问题呢?下以是我对Tomcat和Weblogic的一些性能监控分析方法: 1.  Tomcat性能监控分析 Tomcat是一个免费的开放源代码的

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

部署到weblogic还是比较费劲的 ,不过基本上问题全是由于classloader顺序的问题引起的. 首先在web-inf底下添加weblogic.xml文件如下 [html] view plain copy print? <?xml version="1.0" encoding="UTF-8"?> <weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-

Tomcat、Weblogic、Jboss、WebSphere之间的区别和联系

Tomcat.Weblogic.Jboss.WebSphere之间的区别和联系 Websphere: 这是ibm公司的网上的信息.更详细的信息可以访问网站: http://www-306.ibm.com/software/cn/websphere/ WebSphere 产品家族和解决方案 业务整合整合服务器提供了一套用于应用程序整合和业务流程自动化的中央基础设施. 应用服务器应用服务器提供了运行互操作应用程序的平台. IBM Support for Apache Geronimo IBM Sup

WebLogic中的一些基本概念

WebLogic 中的基本概念 Domain : 域是作为单元进行管理的一组相关的 WebLogic Server 资源.一个域包含一个或多个 WebLogic Server 实例,这些实例可以是群集实例.非群集实例,或者是群集与非群集实例的组合.一个域可以包含多个群集.域还包含部署在域中的应用程序组件.此域中的这些应用程序组件和服务器实例所需的资源和服务.应用程序和服务器实例使用的资源和服务示例包括计算机定义.可选网络通道.连接器和启动类. Domain 中包含一个特殊的 WebLogic 服

认识Weblogic中各个机构

一.认识Weblogic中各个机构 WebLogic是一个企业级的应用服务器,包括j2ee中的各类应用,是jsp,servlet,ejb的容器.功能强大,为了更方便的管理weblogic的各个功能,从逻辑上,将WebLogic 分割成"Domain"而存在.一个WebLogic 可以有多个Domain.在每个Domain中,也要根据不同需求,有各自的划分.先看下图 图中可以看出,一个Domain中有:machine,Server ,Cluster.它们的具体是做什么呢? 二.各个机构的

tomcat在eclipse中起动成功,主页却打不开

tomcat在eclipse中启动成功,主页却打不开 症状: tomcat在eclipse里面能正常启动,而在浏览器中访问http://localhost:8080/不能访问,且报404错误.同时其他项目页面也不能访问. 关闭eclipse里面的tomcat,在tomcat安装目录下双击startup.bat手动启动tomcat服务器.访问htt://localhost:8080/能正常访问tomcat管理页面. 症状原因: eclipse将tomcat的项目发布目录(tomcat 目录中的we

MSM实现tomcat集群中session共享的高可用

目录 1.测试环境概述 2.MSM简介 2.1.MSM的特性 2.2.MSM要解决的问题 2.3.MSM的工作原理 3.环境搭建 3.1.memcached安装 3.2.jkd与tomcat安装配置 3.3.MSM sticky session + kryo模式的配置 3.4.MSM no-sticky session + kryo模式的配置 4.思考与总结 1.测试环境概述 采用两台linux x64主机,主机上分别安装memcached与tomcat,memcached提供key/value

【转载】WebLogic中的一些基本概念

转载自:http://www.cnblogs.com/cocowool/archive/2012/04/01/2428861.html 欢迎阅读原文,我这里只做备份哈. WebLogic 中的基本概念 上周参加了单位组织的WebLogic培训,为了便于自己记忆,培训后,整理梳理了一些WebLogic的资料,会陆续的发出来,下面是一些基本概念. Domain : 域是作为单元进行管理的一组相关的 WebLogic Server 资源.一个域包含一个或多个 WebLogic Server 实例,这些