(i) intercept the *.do, the adorner matches the Do
Tomcat feasible
WebLogic not feasible
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>
~~~
(ii) Interception of forward *.jsp, matching JSP in adorners
Tomcat feasible
WebLogic feasible
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>
~~~
(iii) Interception of *.do, matching both do and JSP in adorners
Tomcat feasible
WebLogic feasible
Reason:
Excerpted from Http://markmail.org/message/gmurb6e5lnnivnw2#query:+page:1+mid:2z2pgcifcyi7ukag+state:result
A request comes in to a servlet, which 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.
Translation:
A request enters Servlet,servlet and uses Requestdispatcher.forward () to a JSP page.
In Tomcat, the information obtained by using Request.getservletpath () before and after Chain.dofilter () is consistent.
In WebLogic, Chain.dofilter () uses Request.getservletpath () to obtain the address after the forward.
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>
~~~