SITEMESH2 configuration issues that are used in both Tomcat and WebLogic

Source: Internet
Author: User

(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>

~~~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.