You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Randy Layman <ra...@aswethink.com> on 2001/04/19 13:54:44 UTC

RE: Servlet Placement and URLs to Run...

	How about http://10.44.82.2:8080/run/pb?  When you specify the
servlet-mapping you are telling Tomcat what URL in the webapp to handle -
/pb means "Any Request for pb in the root of my webapp".  The
/servlet/className convention is a holdover from how the older containers
used to do things and is no longer part of the spec.

	Randy

> -----Original Message-----
> From: Jim Willeke [mailto:jim@willeke.com]
> Sent: Thursday, April 19, 2001 8:09 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Servlet Placement and URLs to Run...
> 
> 
> I have a servlet that I have used in other enviroments without issues.
> I am trying to get it to run under Tomcat and seem to have several 
> roadblocks.
> The Examples work and I do have a servlet SnoopServlet that works in 
> this same container.
> (http://10.44.82.2:8080/run/servlet/SnoopServlet) So, I am 
> assuming the 
> plumbing works and it is a problem with me not knowing where 
> to put this 
> or call that.
> 
> Ther servlet is in \tomcat\webapps\run\WEB-INF\classes
> \tomcat\ is tomcathome
> the actual class file is in:
> \tomcat\webapps\run\WEB-INF\classes\com\willeke\servlet\phoneb
> ook\Phonebook.class
> The servlet being in the package com.willeke.servlet.phonebook
> This runs and works fine in Jbuilder (Which uses tomcat internally)
> 
> The issues I need to resolve:
> 1. What is the right URL to call to load this servlet?
> 
> 
> 2. In the \tomcat\webapps\run\WEB-INF\web.xml I have:
>    <servlet>
>      <servlet-name>
>          Pb
>      </servlet-name>
>      <servlet-class>
>          com.willeke.servlet.phonebook.Phonebook
>      </servlet-class>
>    </servlet>
> 
>    <servlet-mapping>
>        <servlet-name>
>            Pb
>        </servlet-name>
>        <url-pattern>
>            /pb
>        </url-pattern>
>    </servlet-mapping>
> None of the following seem to work:
> http://10.44.82.2:8080/run/servlet/com/willeke/servlet/phonebo
ok/Phonebook
http://10.44.82.2:8080/run/servlet/com.willeke.servlet.phonebook.Phonebook
http://10.44.82.2:8080/run/servlet/Pb
http://10.44.82.2:8080/run/servlet/pb

Any help would be appreciated.
-jim



Re: Servlet Placement and URLs to Run...

Posted by Jim Willeke <ji...@willeke.com>.
No joy. 404 error.

I would like to do it the new current, specfull way. What might that be?
-jim

Randy Layman wrote:

> 	How about http://10.44.82.2:8080/run/pb?  When you specify the
> servlet-mapping you are telling Tomcat what URL in the webapp to handle -
> /pb means "Any Request for pb in the root of my webapp".  The
> /servlet/className convention is a holdover from how the older containers
> used to do things and is no longer part of the spec.
> 
> 	Randy
> 
>> -----Original Message-----
>> From: Jim Willeke [mailto:jim@willeke.com]
>> Sent: Thursday, April 19, 2001 8:09 AM
>> To: tomcat-user@jakarta.apache.org
>> Subject: Servlet Placement and URLs to Run...
>> 
>> 
>> I have a servlet that I have used in other enviroments without issues.
>> I am trying to get it to run under Tomcat and seem to have several 
>> roadblocks.
>> The Examples work and I do have a servlet SnoopServlet that works in 
>> this same container.
>> (http://10.44.82.2:8080/run/servlet/SnoopServlet) So, I am 
>> assuming the 
>> plumbing works and it is a problem with me not knowing where 
>> to put this 
>> or call that.
>> 
>> Ther servlet is in \tomcat\webapps\run\WEB-INF\classes
>> \tomcat\ is tomcathome
>> the actual class file is in:
>> \tomcat\webapps\run\WEB-INF\classes\com\willeke\servlet\phoneb
>> ook\Phonebook.class
>> The servlet being in the package com.willeke.servlet.phonebook
>> This runs and works fine in Jbuilder (Which uses tomcat internally)
>> 
>> The issues I need to resolve:
>> 1. What is the right URL to call to load this servlet?
>> 
>> 
>> 2. In the \tomcat\webapps\run\WEB-INF\web.xml I have:
>>    <servlet>
>>      <servlet-name>
>>          Pb
>>      </servlet-name>
>>      <servlet-class>
>>          com.willeke.servlet.phonebook.Phonebook
>>      </servlet-class>
>>    </servlet>
>> 
>>    <servlet-mapping>
>>        <servlet-name>
>>            Pb
>>        </servlet-name>
>>        <url-pattern>
>>            /pb
>>        </url-pattern>
>>    </servlet-mapping>
>> None of the following seem to work:
>> http://10.44.82.2:8080/run/servlet/com/willeke/servlet/phonebo
> 
> ok/Phonebook
> http://10.44.82.2:8080/run/servlet/com.willeke.servlet.phonebook.Phonebook
> http://10.44.82.2:8080/run/servlet/Pb
> http://10.44.82.2:8080/run/servlet/pb
> 
> Any help would be appreciated.
> -jim
> 
> 
> 
> 
>