You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Matt Smith <ma...@incursiontech.com> on 2001/06/08 20:08:44 UTC

url-pattern matching in web.xml

I am trouble mapping a servlet to be invoked on any call to a directory, or
any of its subdirectories.

For example, I have the Context /context1 under which hello.servlet is
mapped.

I want hello.servlet invoked as

/context1/hello.servlet
/context1/dir1/dir2/dir3/hello.servlet

Basically from the context root and ANY directory beneath context root.

Thanks

matt

RE: url-pattern matching in web.xml

Posted by Matt Smith <ma...@incursiontech.com>.
That is how my web.xml file was setup initially, but the mapper does not
trigger the servlet

web.xml
========
<web-app>
  <servlet>
    <servlet-name>CompanyCall</servlet-name>

<servlet-class>com.incursiontech.product.CompanyCall.CompanyCallServlet</ser
vlet-class>
    <init-param>
      <param-name>dbHost</param-name>
      <param-value>gauntlet</param-value>
    </init-param>
    <init-param>
      <param-name>dbPort</param-name>
      <param-value>3306</param-value>
    </init-param>
    <init-param>
      <param-name>dbUser</param-name>
      <param-value>CompanyCall_pool</param-value>
    </init-param>
    <init-param>
      <param-name>dbPass</param-name>
      <param-value>letMe1n</param-value>
    </init-param>
    <init-param>
      <param-name>dbNumConnections</param-name>
      <param-value>5</param-value>
    </init-param>
    <init-param>
      <param-name>dbDriver</param-name>
      <param-value>org.gjt.mm.mysql.Driver</param-value>
    </init-param>
    <init-param>
      <param-name>mailHost</param-name>
      <param-value>mail.incursiontech.com</param-value>
    </init-param>
  </servlet>
  <servlet-mapping>
    <servlet-name>CompanyCall</servlet-name>
    <url-pattern>CompanyCall.servlet</url-pattern>
  </servlet-mapping>
</web-app>

log from Tomcat
================
2001-06-08 01:21:05 - ContextManager: ProcessRequest:
( /CompanyCall/TollFree/unit1/sess111010101012334432/CompanyCall.servlet)
2001-06-08 01:21:05 - ContextManager: Host = www.incursiontech.com
2001-06-08 01:21:05 - ContextManager: SM: Prefix match
/CompanyCall/TollFree/unit1/sess111010101012334432/CompanyCall.servlet ->
null null
2001-06-08 01:21:05 - ContextManager: SimpleMapper1: Default map
/TollFree/unit1/sess111010101012334432/CompanyCall.servlet null
2001-06-08 01:21:05 - ContextManager: SM: Extension match /CompanyCall
/TollFree/unit1/sess111010101012334432/CompanyCall.servlet .servlet
2001-06-08 01:21:05 - ContextManager: SimpleMapper1: SM: After mapping
( /CompanyCall + /TollFree/unit1/sess111010101012334432/CompanyCall.servlet
+ null) null2001-06-08 01:21:05 - Ctx( www.incursiontech.com:/CompanyCall ):
Get real path /TollFree/unit1/sess111010101012334432/CompanyCall.servlet
/local2/www/incursiontech/htdocs/CompanyCall/TollFree/unit1/sess111010101012
334432/CompanyCall.servlet /local2/www/incursiontech/htdocs/CompanyCall
2001-06-08 01:21:05 - ContextManager: After processing: R( /CompanyCall +
/TollFree/unit1/sess111010101012334432/CompanyCall.servlet + null)
2001-06-08 01:21:05 - ContextManager: No handler for request R( /CompanyCall
+ /TollFree/unit1/sess111010101012334432/CompanyCall.servlet + null) 404
2001-06-08 01:21:05 - Ctx( www.incursiontech.com:/CompanyCall ): 404
( /CompanyCall + /TollFree/unit1/sess111010101012334432/CompanyCall.servlet
+ null) null
2001-06-08 01:21:05 - Ctx( www.incursiontech.com:/CompanyCall ): Handler
tomcat.notFoundHandler(null/null) tomcat.notFoundHandler




-----Original Message-----
From: Filip Hanik [mailto:mail@filip.net]
Sent: Friday, June 08, 2001 1:20 PM
To: tomcat-user@jakarta.apache.org; matt@incursiontech.com
Subject: RE: url-pattern matching in web.xml



<servlet>
    <servlet-name>
        your-servlet-name
    </servlet-name>
    <servlet-class>
        my.com.hello.servlet
    </servlet-class>
</servlet>

<servlet-mapping>
  <servlet-name>
    your-servlet-name
  </servlet-name>
  <url-pattern>
    hello.servlet
  </url-pattern>
</servlet-mapping>

~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
filip@filip.net
www.filip.net
-----Original Message-----
From: Matt Smith [mailto:matt@incursiontech.com]
Sent: Friday, June 08, 2001 11:09 AM
To: tomcat-user@jakarta.apache.org
Subject: url-pattern matching in web.xml


I am trouble mapping a servlet to be invoked on any call to a directory, or
any of its subdirectories.

For example, I have the Context /context1 under which hello.servlet is
mapped.

I want hello.servlet invoked as

/context1/hello.servlet
/context1/dir1/dir2/dir3/hello.servlet

Basically from the context root and ANY directory beneath context root.

Thanks

matt


RE: url-pattern matching in web.xml

Posted by Filip Hanik <ma...@filip.net>.
<servlet>
    <servlet-name>
        your-servlet-name
    </servlet-name>
    <servlet-class>
        my.com.hello.servlet
    </servlet-class>
</servlet>

<servlet-mapping>
  <servlet-name>
    your-servlet-name
  </servlet-name>
  <url-pattern>
    hello.servlet
  </url-pattern>
</servlet-mapping>

~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
filip@filip.net
www.filip.net
-----Original Message-----
From: Matt Smith [mailto:matt@incursiontech.com]
Sent: Friday, June 08, 2001 11:09 AM
To: tomcat-user@jakarta.apache.org
Subject: url-pattern matching in web.xml


I am trouble mapping a servlet to be invoked on any call to a directory, or
any of its subdirectories.

For example, I have the Context /context1 under which hello.servlet is
mapped.

I want hello.servlet invoked as

/context1/hello.servlet
/context1/dir1/dir2/dir3/hello.servlet

Basically from the context root and ANY directory beneath context root.

Thanks

matt