question about configuring the controler mapping of the struts controler
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   zhebin_cong
Posted On:   Sunday, September 22, 2002 12:15 AM

hello


in the "web.xml",i config the "servlet-mapping" of the struts controler as "*.do",it works well in both tomcat4 and weblogic6.1,but if i modify it to "/*.do",the weblogic works,but the tomcat dons't work.


otherwisw,if i setup the mapping as "/sub/*.do",and modify the hyperlink in the caller page accordingly(add the "sub" to the url),both the tomcat and weblogic don't work,why?



thank you very much!

Re: question about configuring the controler mapping of the struts controler

Posted By:   Erin_Mulder  
Posted On:   Wednesday, September 25, 2002 01:20 PM

Take a look at Section 11.2 of the Servlet 2.3 specification. URL patterns are defined as follows:



  • A string beginning with a ‘/’ character and ending with a ‘/*’ postfix is used
    for path mapping.
  • A string beginning with a ‘*.’ prefix is used as an extension mapping.
  • A string containing only the ’/’ character indicates the "default" servlet of the
    application. In this case the servlet path is the request URI minus the context
    path and the path info is null.
  • All other strings are used for exact matches only.


It is not clear that you are allowed to mix path mappings and extension mappings. In other words, /* is okay and *.do is okay, but /*.do should fall through to the last condition, requiring an exact match (instead of interpreting the wildcard).

About | Sitemap | Contact