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> /xxxx/*    ....  ???
>
> What does that (only wildcard-part interesting: "*" !!!) inside a servlet-mapping 
>mean:
>
> <url-pattern> /xxxx/* </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 "/xxxx" 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/xxxx/foo/bar.html

will call your servlet, which can then get the following:

  request.getContextPath() will return "/myapp"
  request.getServletPath() will return "/xxxx"
  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 "/xxxx/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]>

Reply via email to