On Thu, 28 Feb 2002, Thomas Stiller wrote:
Date: Thu, 28 Feb 2002 16:57:32 -0500
From: Thomas Stiller [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Meaning of url-pattern //* ???
What does that (only wildcard-part interesting: * !!!) inside a servlet-mapping
mean:
url-pattern //* /url-pattern
Does that mean search in this subdirectory tree
or does it mean search the name corresponding
servlet or what ?
Thx for answerĂng this beginner question
Thomas
No, it means that your servlet will match the / part, and anything
else will be returned to use as extra path info.
For example, assume you have the above mapping in a webapp mapped to
context path /myapp. Now, a URL like this:
http://localhost:8080/myapp//foo/bar.html
will call your servlet, which can then get the following:
request.getContextPath() will return /myapp
request.getServletPath() will return /
request.getPathInfo() will return /foo/bar.html
Using extra path info is a common way to pass parameters to a servlet as
part of the request URL itself. In addition, it totally hides the fact
that there is no static resource named //foo/bar.html in your app,
so the client has no way to know whether this response is being produced
dynamically or statically.
See the Servlet Specification for what everything in the web.xml file
means:
http://java.sun.com/products/servlet/download.html
Craig
--
___
Sign-up for your own FREE Personalized E-mail at Email.com
http://www.email.com/?sr=signup
--
To unsubscribe: mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]
--
To unsubscribe: mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]