You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Thomas Stiller <to...@email.com> on 2002/02/28 22:57:32 UTC

Meaning of /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

-- 

_______________________________________________
Sign-up for your own FREE Personalized E-mail at Email.com
http://www.email.com/?sr=signup



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Meaning of /xxxx/* .... ???

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 28 Feb 2002, Thomas Stiller wrote:

> Date: Thu, 28 Feb 2002 16:57:32 -0500
> From: Thomas Stiller <to...@email.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> 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:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>