You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by adi <ad...@myrealbox.com> on 2002/09/19 14:50:34 UTC

url patterns

Hello,

Does anybody know the valid url patterns for servlet mappings?

is there a pattern for all subdirectories of a certain directory?

something like: 
 <servlet-mapping>
    <servlet-name>default1</servlet-name>
    <url-pattern>/admin/**/</url-pattern>
  </servlet-mapping>

Thanks,
Adi
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.372 / Virus Database: 207 - Release Date: 6/20/2002


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: url patterns

Posted by Jacob Kjome <ho...@visi.com>.
Hello adi,

You are close.

Try this:

<servlet-mapping>
    <servlet-name>default1</servlet-name>
    <url-pattern>/admin/*</url-pattern>
</servlet-mapping>

Now if you go to something like:

http://localhost:8080/mycontext/admin/this/will/show/up/as/path/info/to/this/document.txt

if you call HttpServletRequest#getPathInfo() it will return:
"/this/will/show/up/as/path/info/to/this/document.txt"

Or you can do HttpServletRequest#getPathTranslated() which returns the
system path to the file (assuming it exists).

Jake


Thursday, September 19, 2002, 7:50:34 AM, you wrote:

a> Hello,

a> Does anybody know the valid url patterns for servlet mappings?

a> is there a pattern for all subdirectories of a certain directory?

a> something like: 
a>  <servlet-mapping>
a>     <servlet-name>default1</servlet-name>
a>     <url-pattern>/admin/**/</url-pattern>
a>   </servlet-mapping>

a> Thanks,
a> Adi
a> ---
a> Outgoing mail is certified Virus Free.
a> Checked by AVG anti-virus system (http://www.grisoft.com).
a> Version: 6.0.372 / Virus Database: 207 - Release Date: 6/20/2002


a> --
a> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
a> For additional commands, e-mail: <ma...@jakarta.apache.org>



-- 
Best regards,
 Jacob                            mailto:hoju@visi.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: url patterns

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

On Thu, 19 Sep 2002, adi wrote:

> Date: Thu, 19 Sep 2002 13:50:34 +0100
> From: adi <ad...@myrealbox.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: url patterns
>
> Hello,
>
> Does anybody know the valid url patterns for servlet mappings?
>

See Chapter 11 of the Servlet Specification:

  http://java.sun.com/products/servlet/download.html

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>