when tomcat know "*" as "any"?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   zhebin_cong
Posted On:   Friday, February 22, 2002 07:47 AM

hello my "web.xml" as follow: <?xml version="1.0" encoding="ISO-8859-1"?> PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd"> freak FreakServlet waitInterval 5 freak *.do i confuse with the "url-pattern" tag,when i special "*.do",in the browser,"http://localhost:8080/freak/a.do" works well. if "/*.do",then "http://localhost:8080/freak/a.do" don't work(page not found),but "http://localhost:8080/freak/*.do" works.    More>>


hello


my "web.xml" as follow:



<?xml version="1.0" encoding="ISO-8859-1"?>


PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">


freak
FreakServlet

waitInterval
5



freak
*.do




i confuse with the "url-pattern" tag,when i special "*.do",in the browser,"http://localhost:8080/freak/a.do" works well.


if "/*.do",then "http://localhost:8080/freak/a.do" don't work(page not found),but "http://localhost:8080/freak/*.do" works.


if "/*",all of them works.and you can cancatenate any string to "http://localhost:8080/freak/".


i wonder when the tomcat know the "*" as "any".



thanks in advance!


.    <<Less

Re: when tomcat know "*" as "any"?

Posted By:   Luigi_Viggiano  
Posted On:   Sunday, February 24, 2002 03:08 PM

Servlet Spec 2.3 (chapter SRV.11, page 76) says:



Specification of Mappings


In the web application deployment descriptor, the following syntax is used to define mappings:



  • 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.
About | Sitemap | Contact