tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mihai Gheorghiu" <tane...@earthlink.net>
Subject Re: Two servlets
Date Wed, 07 Nov 2001 23:00:11 GMT
Please excuse my ignorance. I did my best to try to understand Java servlet
specification v2.2, and here you saw the result :-(
>From what you wrote and what I read there, it results that a servlet is
designed to listen to requests coming from one or more components (html
pages, applets) located in a path that is to be declared in
<servlet-mapping>.
My problem is: can I have more than one servlet to listen to requests coming
from one source?
Thanks again for your patience.

-----Original Message-----
From: Randy Layman <randy.layman@aswethink.com>
To: Tomcat Users List <tomcat-user@jakarta.apache.org>
Date: Wednesday, November 07, 2001 4:38 PM
Subject: RE: Two servlets


>
> It doesn't have to be servlets.  If you have your servlet listen to
>/servlets/da then any time the users/other pages ask for exactly
/servlet/da
>then the servlet will be run.  The reason to use /servlets/da/* is to
enable
>Path Information (accessed using the getPathInfo on the request object).
>Its useful when you don't want users to know what is the servlet and what
is
>the parameter (i.e. creating a URL like /servlets/bob/filename and having
>bob be the servlet name and filename being a parameter).
>
> Randy
>
>
>> -----Original Message-----
>> From: Mihai Gheorghiu [mailto:tanethq@earthlink.net]
>> Sent: Wednesday, November 07, 2001 2:56 PM
>> To: Tomcat Users List
>> Subject: Re: Two servlets
>>
>>
>> Thanks a lot.
>> In newbie's terms, create one folder per servlet and address them
>> accordingly?
>>
>> -----Original Message-----
>> From: Randy Layman <randy.layman@aswethink.com>
>> To: Tomcat Users List <tomcat-user@jakarta.apache.org>
>> Date: Wednesday, November 07, 2001 2:38 PM
>> Subject: RE: Two servlets
>>
>>
>> >
>> > You are assigning both servlets to listen for the same URL (anything
>> >that starts with /servlets/*).  This can not happen - each URL can be
>> >serviced by at most one servlet (although the servlet can
>> pass control to
>> >other servlets).  You need to assign each servlet its own unique URL
>> pattern
>> >(i.e. /servlets/da/* and /servlets/title/*).
>> >
>> > Randy
>> >
>> >
>> >> -----Original Message-----
>> >> From: Mihai Gheorghiu [mailto:tanethq@earthlink.net]
>> >> Sent: Wednesday, November 07, 2001 2:32 PM
>> >> To: tomcat-user@jakarta.apache.org
>> >> Subject: Two servlets
>> >>
>> >>
>> >> I want to use two servlets from the same applet/web page, and
>> >> it does not
>> >> work. I'm doing something definitely wrong in web.xml, as
>> >> tomcat.log lists
>> >> (among others):
>> >> 2001-11-07 03:03:37 - Ctx( /development ): Removing duplicate
>> >> /servlet/* ->TitlesServlet(Sales.TitlesServlet/null)
>> >> The relevant web.xml part is:
>> >>  <servlet>
>> >>   <servlet-name>TitlesServlet</servlet-name>
>> >>   <servlet-class>Sales.TitlesServlet</servlet-class>
>> >>  </servlet>
>> >>  <servlet-mapping>
>> >>   <servlet-name>TitlesServlet</servlet-name>
>> >>   <url-pattern>/servlet/*</url-pattern>
>> >>  </servlet-mapping>
>> >>  <servlet>
>> >>   <servlet-name>DaServlet</servlet-name>
>> >>   <servlet-class>Sales.DaServlet</servlet-class>
>> >>  </servlet>
>> >>  <servlet-mapping>
>> >>   <servlet-name>DaServlet</servlet-name>
>> >>   <url-pattern>/servlet/*</url-pattern>
>> >>  </servlet-mapping>
>> >> How do I declare more than one servlet being used from one applet?
>> >> Thank you all.
>> >>
>> >>
>> >> --
>> >> To unsubscribe:
>> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>> >> For additional commands:
>> <mailto:tomcat-user-help@jakarta.apache.org>
>> >> Troubles with the list:
>> <mailto:tomcat-user-owner@jakarta.apache.org>
>> >>
>> >
>> >--
>> >To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>> >For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
>> >Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
>> >
>>
>>
>> --
>> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
>> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
>>
>
>--
>To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
>Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
>


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message