You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jason Jesso <jj...@global-matrix.com> on 2003/09/03 20:27:43 UTC

adding a servlet to my webapp

When I go to my servlet I get "HTTP Status 404 - 
/jasonTest/servlet/foo/HelloWorld"

The url is:
http://neptune/jasonTest/servlet/foo/HelloWorld

My config is as follows:  (What is wrong here??)

I have a webapp defined in server.xml as

=======================
       <Context path="/jasonTest"
            docBase="jasonTest"
            debug="0"
            reloadable="true"
            crossContext="true">
            <Logger className="org.apache.catalina.logger.FileLogger" 
prefix="jasonTest" suffix=".out"/>
        </Context>
=======================


My webapp directory structure looks like:
=======================
neptune:root> ls -lR jasonTest/
total 16
drwxr-sr-x   4 root     software        512 Sep 03 10:18 WEB-INF
-rw-r--r--   1 root     software         43 Sep 03 10:10 index.html
jasonTest/WEB-INF:
total 24
drwxr-sr-x   3 root     software        512 Sep 03 11:12 classes
drwxr-sr-x   2 root     software        512 Sep 03 10:09 lib
-rw-r--r--   1 root     software        328 Sep 03 14:22 web.xml

jasonTest/WEB-INF/classes:
total 8
drwxr-sr-x   2 root     software        512 Sep 03 10:31 foo

jasonTest/WEB-INF/classes/foo:
total 8
-rw-r-----   1 root     software        815 Sep 03 10:31 HelloWorld.class

jasonTest/WEB-INF/lib:
total 0
neptune:root>
=======================

My web.xml looks like:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

 <servlet>
    <servlet-name>HelloWorld</servlet-name>
    <servlet-class>/servlet/foo/HelloWorld</servlet-class>
 </servlet>

</web-app>


-- 
<jason/>




Re: adding a servlet to my webapp

Posted by Justin Ruthenbeck <ju...@nextengine.com>.
At 12:36 PM 9/3/2003, you wrote:
>My guess is that this is right then:
><servlet>
>        <servlet-name>HelloWorld</servlet-name>
>        <servlet-class>HelloWorld</servlet-class>
></servlet>
><servlet-mapping>
>        <servlet-name>HelloWorld</servlet-name>
>        <url-pattern>/servlet/foo/HelloWorld</url-pattern>
></servlet-mapping>
>
>Do I need the "mypackage" thing?

 From your ls output that you gave originally, it looks like you've 
got  HelloWorld in a package called foo.  So, yes -- you need the 
"mypackage" thing.  It should be

><servlet>
>        <servlet-name>HelloWorld</servlet-name>
>        <servlet-class>foo.HelloWorld</servlet-class>
></servlet>

Try that out...

justin


>Justin Ruthenbeck wrote:
>
>>Jason,
>>
>>John was pointing out that you're missing the <servlet-mapping> which 
>>basically says, "For a URL that looks like X, send the request to servlet 
>>Y."  You've also got a malformed <servlet-class> value.
>>Something like this should work...
>>
>><servlet>
>>         <servlet-name>HelloWorld</servlet-name>
>>         <servlet-class>mypackage.HelloWorld</servlet-class>
>></servlet>
>><servlet-mapping>
>>         <servlet-name>HelloWorld</servlet-name>
>>         <url-pattern>/servlet/foo/HelloWorld</url-pattern>
>></servlet-mapping>
>>
>>justin
>>
>>
>>At 12:02 PM 9/3/2003, you wrote:
>>
>>>But,  I don't want to use the "invoker".  I want to be able to specify 
>>>the servlet itself in web.xml.
>>>
>>>The invoker is "evil" according to the link you gave me.
>>>
>>>
>>>
>>>John Turner wrote:
>>>
>>>>
>>>>You have to map your servlet in web.xml.
>>>>
>>>>FAQ: http://jakarta.apache.org/tomcat/faq/misc.html#invoker
>>>>
>>>>John
>>>>
>>>>Jason Jesso wrote:
>>>>
>>>>>When I go to my servlet I get "HTTP Status 404 - 
>>>>>/jasonTest/servlet/foo/HelloWorld"
>>>>>
>>>>>The url is:
>>>>>http://neptune/jasonTest/servlet/foo/HelloWorld
>>>>>
>>>>>My config is as follows:  (What is wrong here??)
>>>>>
>>>>>I have a webapp defined in server.xml as
>>>>>
>>>>>=======================
>>>>>       <Context path="/jasonTest"
>>>>>            docBase="jasonTest"
>>>>>            debug="0"
>>>>>            reloadable="true"
>>>>>            crossContext="true">
>>>>>            <Logger className="org.apache.catalina.logger.FileLogger" 
>>>>> prefix="jasonTest" suffix=".out"/>
>>>>>        </Context>
>>>>>=======================
>>>>>
>>>>>
>>>>>My webapp directory structure looks like:
>>>>>=======================
>>>>>neptune:root> ls -lR jasonTest/
>>>>>total 16
>>>>>drwxr-sr-x   4 root     software        512 Sep 03 10:18 WEB-INF
>>>>>-rw-r--r--   1 root     software         43 Sep 03 10:10 index.html
>>>>>jasonTest/WEB-INF:
>>>>>total 24
>>>>>drwxr-sr-x   3 root     software        512 Sep 03 11:12 classes
>>>>>drwxr-sr-x   2 root     software        512 Sep 03 10:09 lib
>>>>>-rw-r--r--   1 root     software        328 Sep 03 14:22 web.xml
>>>>>
>>>>>jasonTest/WEB-INF/classes:
>>>>>total 8
>>>>>drwxr-sr-x   2 root     software        512 Sep 03 10:31 foo
>>>>>
>>>>>jasonTest/WEB-INF/classes/foo:
>>>>>total 8
>>>>>-rw-r-----   1 root     software        815 Sep 03 10:31 HelloWorld.class
>>>>>
>>>>>jasonTest/WEB-INF/lib:
>>>>>total 0
>>>>>neptune:root>
>>>>>=======================
>>>>>
>>>>>My web.xml looks like:
>>>>>
>>>>><?xml version="1.0" encoding="ISO-8859-1"?>
>>>>>
>>>>><!DOCTYPE web-app
>>>>>    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>>>>>    "http://java.sun.com/dtd/web-app_2_3.dtd">
>>>>>
>>>>><web-app>
>>>>>
>>>>><servlet>
>>>>>    <servlet-name>HelloWorld</servlet-name>
>>>>>    <servlet-class>/servlet/foo/HelloWorld</servlet-class>
>>>>></servlet>
>>>>>
>>>>></web-app>
>>>>
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>
>>>--
>>><jason/>


____________________________________
Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential
    See http://www.nextengine.com/confidentiality.php
____________________________________


RE: adding a servlet to my webapp

Posted by Schalk <sc...@volume4.co.za>.
If you want to read a great article on web.xml check out:
http://developer.java.sun.com/developer/Books/javaserverpages/servlets_javas
erver/

Kind Regards
Schalk Neethling
Volume4.Development.Multimedia.Branding
emotionalize.conceptualize.visualize.realize
Tel: +27125468436
Fax: +27125468436
email:schalk@volume4.co.za
web: www.volume4.co.za
 

:: -----Original Message-----
:: From: Jason Jesso [mailto:jjesso@global-matrix.com]
:: Sent: Wednesday, September 03, 2003 10:04 PM
:: To: Tomcat Users List
:: Subject: Re: adding a servlet to my webapp
:: 
:: Perfect.  That works.
:: 
:: Thanks
:: 
:: Jon Wingfield wrote:
:: 
:: > Given your initial post your class HelloWorld was in
:: > jasonTest/WEB-INF/classes/foo
:: >
:: > So either HelloWorld must be in a package foo. ie the first code line
:: > of the Helloworld source is:
:: > package foo;
:: >
:: > or you need to put HelloWorld.class in
:: > jasonTest/WEB-INF/classes
:: >
:: > http://jakarta.apache.org/tomcat/tomcat-4.1-doc/appdev/deployment.html
:: >
:: > HTH,
:: >
:: > Jon
:: >
:: >
:: > Jason Jesso wrote:
:: >
:: >> My guess is that this is right then:
:: >>
:: >> <?xml version="1.0" encoding="ISO-8859-1"?>
:: >>
:: >> <!DOCTYPE web-app
:: >>    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
:: >>    "http://java.sun.com/dtd/web-app_2_3.dtd">
:: >>
:: >> <web-app>
:: >>
:: >> <servlet>
:: >>        <servlet-name>HelloWorld</servlet-name>
:: >>        <servlet-class>HelloWorld</servlet-class>
:: >> </servlet>
:: >> <servlet-mapping>
:: >>        <servlet-name>HelloWorld</servlet-name>
:: >>        <url-pattern>/servlet/foo/HelloWorld</url-pattern>
:: >> </servlet-mapping>
:: >>
:: >> </web-app>
:: >>
:: >> Do I need the "mypackage" thing?
:: >>
:: >> With what I have above I get a "HTTP Status 500 -
:: >>
:: >> root cause
:: >>
:: >> java.lang.ClassNotFoundException: HelloWorld
:: >>
:: >>
:: >>
:: >>
:: >>
:: >>
:: >> Justin Ruthenbeck wrote:
:: >>
:: >>> Jason,
:: >>>
:: >>> John was pointing out that you're missing the <servlet-mapping>
:: >>> which basically says, "For a URL that looks like X, send the request
:: >>> to servlet Y."  You've also got a malformed <servlet-class> value.
:: >>> Something like this should work...
:: >>>
:: >>> <servlet>
:: >>>         <servlet-name>HelloWorld</servlet-name>
:: >>>         <servlet-class>mypackage.HelloWorld</servlet-class>
:: >>> </servlet>
:: >>> <servlet-mapping>
:: >>>         <servlet-name>HelloWorld</servlet-name>
:: >>>         <url-pattern>/servlet/foo/HelloWorld</url-pattern>
:: >>> </servlet-mapping>
:: >>>
:: >>> justin
:: >>>
:: >>>
:: >>> At 12:02 PM 9/3/2003, you wrote:
:: >>>
:: >>>> But,  I don't want to use the "invoker".  I want to be able to
:: >>>> specify the servlet itself in web.xml.
:: >>>>
:: >>>> The invoker is "evil" according to the link you gave me.
:: >>>>
:: >>>>
:: >>>>
:: >>>> John Turner wrote:
:: >>>>
:: >>>>>
:: >>>>> You have to map your servlet in web.xml.
:: >>>>>
:: >>>>> FAQ: http://jakarta.apache.org/tomcat/faq/misc.html#invoker
:: >>>>>
:: >>>>> John
:: >>>>>
:: >>>>> Jason Jesso wrote:
:: >>>>>
:: >>>>>> When I go to my servlet I get "HTTP Status 404 -
:: >>>>>> /jasonTest/servlet/foo/HelloWorld"
:: >>>>>>
:: >>>>>> The url is:
:: >>>>>> http://neptune/jasonTest/servlet/foo/HelloWorld
:: >>>>>>
:: >>>>>> My config is as follows:  (What is wrong here??)
:: >>>>>>
:: >>>>>> I have a webapp defined in server.xml as
:: >>>>>>
:: >>>>>> =======================
:: >>>>>>       <Context path="/jasonTest"
:: >>>>>>            docBase="jasonTest"
:: >>>>>>            debug="0"
:: >>>>>>            reloadable="true"
:: >>>>>>            crossContext="true">
:: >>>>>>            <Logger
:: >>>>>> className="org.apache.catalina.logger.FileLogger"
:: >>>>>> prefix="jasonTest" suffix=".out"/>
:: >>>>>>        </Context>
:: >>>>>> =======================
:: >>>>>>
:: >>>>>>
:: >>>>>> My webapp directory structure looks like:
:: >>>>>> =======================
:: >>>>>> neptune:root> ls -lR jasonTest/
:: >>>>>> total 16
:: >>>>>> drwxr-sr-x   4 root     software        512 Sep 03 10:18 WEB-INF
:: >>>>>> -rw-r--r--   1 root     software         43 Sep 03 10:10
index.html
:: >>>>>> jasonTest/WEB-INF:
:: >>>>>> total 24
:: >>>>>> drwxr-sr-x   3 root     software        512 Sep 03 11:12 classes
:: >>>>>> drwxr-sr-x   2 root     software        512 Sep 03 10:09 lib
:: >>>>>> -rw-r--r--   1 root     software        328 Sep 03 14:22 web.xml
:: >>>>>>
:: >>>>>> jasonTest/WEB-INF/classes:
:: >>>>>> total 8
:: >>>>>> drwxr-sr-x   2 root     software        512 Sep 03 10:31 foo
:: >>>>>>
:: >>>>>> jasonTest/WEB-INF/classes/foo:
:: >>>>>> total 8
:: >>>>>> -rw-r-----   1 root     software        815 Sep 03 10:31
:: >>>>>> HelloWorld.class
:: >>>>>>
:: >>>>>> jasonTest/WEB-INF/lib:
:: >>>>>> total 0
:: >>>>>> neptune:root>
:: >>>>>> =======================
:: >>>>>>
:: >>>>>> My web.xml looks like:
:: >>>>>>
:: >>>>>> <?xml version="1.0" encoding="ISO-8859-1"?>
:: >>>>>>
:: >>>>>> <!DOCTYPE web-app
:: >>>>>>    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
:: >>>>>>    "http://java.sun.com/dtd/web-app_2_3.dtd">
:: >>>>>>
:: >>>>>> <web-app>
:: >>>>>>
:: >>>>>> <servlet>
:: >>>>>>    <servlet-name>HelloWorld</servlet-name>
:: >>>>>>    <servlet-class>/servlet/foo/HelloWorld</servlet-class>
:: >>>>>> </servlet>
:: >>>>>>
:: >>>>>> </web-app>
:: >>>>>>
:: >
:: >
:: >
:: >
:: > ---------------------------------------------------------------------
:: > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
:: > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
:: >
:: >
:: 
:: --
:: <jason/>
:: 
:: 
:: 
:: 
:: 
:: ---------------------------------------------------------------------
:: To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
:: For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



Re: adding a servlet to my webapp

Posted by Jason Jesso <jj...@global-matrix.com>.
Perfect.  That works.

Thanks

Jon Wingfield wrote:

> Given your initial post your class HelloWorld was in
> jasonTest/WEB-INF/classes/foo
>
> So either HelloWorld must be in a package foo. ie the first code line 
> of the Helloworld source is:
> package foo;
>
> or you need to put HelloWorld.class in
> jasonTest/WEB-INF/classes
>
> http://jakarta.apache.org/tomcat/tomcat-4.1-doc/appdev/deployment.html
>
> HTH,
>
> Jon
>
>
> Jason Jesso wrote:
>
>> My guess is that this is right then:
>>
>> <?xml version="1.0" encoding="ISO-8859-1"?>
>>
>> <!DOCTYPE web-app
>>    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>>    "http://java.sun.com/dtd/web-app_2_3.dtd">
>>
>> <web-app>
>>
>> <servlet>
>>        <servlet-name>HelloWorld</servlet-name>
>>        <servlet-class>HelloWorld</servlet-class>
>> </servlet>
>> <servlet-mapping>
>>        <servlet-name>HelloWorld</servlet-name>
>>        <url-pattern>/servlet/foo/HelloWorld</url-pattern>
>> </servlet-mapping>
>>
>> </web-app>
>>
>> Do I need the "mypackage" thing?
>>
>> With what I have above I get a "HTTP Status 500 -
>>
>> root cause
>>
>> java.lang.ClassNotFoundException: HelloWorld
>>
>>
>>
>>
>>
>>
>> Justin Ruthenbeck wrote:
>>
>>> Jason,
>>>
>>> John was pointing out that you're missing the <servlet-mapping> 
>>> which basically says, "For a URL that looks like X, send the request 
>>> to servlet Y."  You've also got a malformed <servlet-class> value.  
>>> Something like this should work...
>>>
>>> <servlet>
>>>         <servlet-name>HelloWorld</servlet-name>
>>>         <servlet-class>mypackage.HelloWorld</servlet-class>
>>> </servlet>
>>> <servlet-mapping>
>>>         <servlet-name>HelloWorld</servlet-name>
>>>         <url-pattern>/servlet/foo/HelloWorld</url-pattern>
>>> </servlet-mapping>
>>>
>>> justin
>>>
>>>
>>> At 12:02 PM 9/3/2003, you wrote:
>>>
>>>> But,  I don't want to use the "invoker".  I want to be able to 
>>>> specify the servlet itself in web.xml.
>>>>
>>>> The invoker is "evil" according to the link you gave me.
>>>>
>>>>
>>>>
>>>> John Turner wrote:
>>>>
>>>>>
>>>>> You have to map your servlet in web.xml.
>>>>>
>>>>> FAQ: http://jakarta.apache.org/tomcat/faq/misc.html#invoker
>>>>>
>>>>> John
>>>>>
>>>>> Jason Jesso wrote:
>>>>>
>>>>>> When I go to my servlet I get "HTTP Status 404 - 
>>>>>> /jasonTest/servlet/foo/HelloWorld"
>>>>>>
>>>>>> The url is:
>>>>>> http://neptune/jasonTest/servlet/foo/HelloWorld
>>>>>>
>>>>>> My config is as follows:  (What is wrong here??)
>>>>>>
>>>>>> I have a webapp defined in server.xml as
>>>>>>
>>>>>> =======================
>>>>>>       <Context path="/jasonTest"
>>>>>>            docBase="jasonTest"
>>>>>>            debug="0"
>>>>>>            reloadable="true"
>>>>>>            crossContext="true">
>>>>>>            <Logger 
>>>>>> className="org.apache.catalina.logger.FileLogger" 
>>>>>> prefix="jasonTest" suffix=".out"/>
>>>>>>        </Context>
>>>>>> =======================
>>>>>>
>>>>>>
>>>>>> My webapp directory structure looks like:
>>>>>> =======================
>>>>>> neptune:root> ls -lR jasonTest/
>>>>>> total 16
>>>>>> drwxr-sr-x   4 root     software        512 Sep 03 10:18 WEB-INF
>>>>>> -rw-r--r--   1 root     software         43 Sep 03 10:10 index.html
>>>>>> jasonTest/WEB-INF:
>>>>>> total 24
>>>>>> drwxr-sr-x   3 root     software        512 Sep 03 11:12 classes
>>>>>> drwxr-sr-x   2 root     software        512 Sep 03 10:09 lib
>>>>>> -rw-r--r--   1 root     software        328 Sep 03 14:22 web.xml
>>>>>>
>>>>>> jasonTest/WEB-INF/classes:
>>>>>> total 8
>>>>>> drwxr-sr-x   2 root     software        512 Sep 03 10:31 foo
>>>>>>
>>>>>> jasonTest/WEB-INF/classes/foo:
>>>>>> total 8
>>>>>> -rw-r-----   1 root     software        815 Sep 03 10:31 
>>>>>> HelloWorld.class
>>>>>>
>>>>>> jasonTest/WEB-INF/lib:
>>>>>> total 0
>>>>>> neptune:root>
>>>>>> =======================
>>>>>>
>>>>>> My web.xml looks like:
>>>>>>
>>>>>> <?xml version="1.0" encoding="ISO-8859-1"?>
>>>>>>
>>>>>> <!DOCTYPE web-app
>>>>>>    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>>>>>>    "http://java.sun.com/dtd/web-app_2_3.dtd">
>>>>>>
>>>>>> <web-app>
>>>>>>
>>>>>> <servlet>
>>>>>>    <servlet-name>HelloWorld</servlet-name>
>>>>>>    <servlet-class>/servlet/foo/HelloWorld</servlet-class>
>>>>>> </servlet>
>>>>>>
>>>>>> </web-app>
>>>>>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>

-- 
<jason/>





Re: adding a servlet to my webapp

Posted by Jon Wingfield <jo...@mkodo.com>.
Given your initial post your class HelloWorld was in
jasonTest/WEB-INF/classes/foo

So either HelloWorld must be in a package foo. ie the first code line of 
the Helloworld source is:
package foo;

or you need to put HelloWorld.class in
jasonTest/WEB-INF/classes

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/appdev/deployment.html

HTH,

Jon


Jason Jesso wrote:

> My guess is that this is right then:
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> 
> <!DOCTYPE web-app
>    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>    "http://java.sun.com/dtd/web-app_2_3.dtd">
> 
> <web-app>
> 
> <servlet>
>        <servlet-name>HelloWorld</servlet-name>
>        <servlet-class>HelloWorld</servlet-class>
> </servlet>
> <servlet-mapping>
>        <servlet-name>HelloWorld</servlet-name>
>        <url-pattern>/servlet/foo/HelloWorld</url-pattern>
> </servlet-mapping>
> 
> </web-app>
> 
> Do I need the "mypackage" thing?
> 
> With what I have above I get a "HTTP Status 500 -
> 
> root cause
> 
> java.lang.ClassNotFoundException: HelloWorld
> 
> 
> 
> 
> 
> 
> Justin Ruthenbeck wrote:
> 
>> Jason,
>>
>> John was pointing out that you're missing the <servlet-mapping> which 
>> basically says, "For a URL that looks like X, send the request to 
>> servlet Y."  You've also got a malformed <servlet-class> value.  
>> Something like this should work...
>>
>> <servlet>
>>         <servlet-name>HelloWorld</servlet-name>
>>         <servlet-class>mypackage.HelloWorld</servlet-class>
>> </servlet>
>> <servlet-mapping>
>>         <servlet-name>HelloWorld</servlet-name>
>>         <url-pattern>/servlet/foo/HelloWorld</url-pattern>
>> </servlet-mapping>
>>
>> justin
>>
>>
>> At 12:02 PM 9/3/2003, you wrote:
>>
>>> But,  I don't want to use the "invoker".  I want to be able to 
>>> specify the servlet itself in web.xml.
>>>
>>> The invoker is "evil" according to the link you gave me.
>>>
>>>
>>>
>>> John Turner wrote:
>>>
>>>>
>>>> You have to map your servlet in web.xml.
>>>>
>>>> FAQ: http://jakarta.apache.org/tomcat/faq/misc.html#invoker
>>>>
>>>> John
>>>>
>>>> Jason Jesso wrote:
>>>>
>>>>> When I go to my servlet I get "HTTP Status 404 - 
>>>>> /jasonTest/servlet/foo/HelloWorld"
>>>>>
>>>>> The url is:
>>>>> http://neptune/jasonTest/servlet/foo/HelloWorld
>>>>>
>>>>> My config is as follows:  (What is wrong here??)
>>>>>
>>>>> I have a webapp defined in server.xml as
>>>>>
>>>>> =======================
>>>>>       <Context path="/jasonTest"
>>>>>            docBase="jasonTest"
>>>>>            debug="0"
>>>>>            reloadable="true"
>>>>>            crossContext="true">
>>>>>            <Logger 
>>>>> className="org.apache.catalina.logger.FileLogger" 
>>>>> prefix="jasonTest" suffix=".out"/>
>>>>>        </Context>
>>>>> =======================
>>>>>
>>>>>
>>>>> My webapp directory structure looks like:
>>>>> =======================
>>>>> neptune:root> ls -lR jasonTest/
>>>>> total 16
>>>>> drwxr-sr-x   4 root     software        512 Sep 03 10:18 WEB-INF
>>>>> -rw-r--r--   1 root     software         43 Sep 03 10:10 index.html
>>>>> jasonTest/WEB-INF:
>>>>> total 24
>>>>> drwxr-sr-x   3 root     software        512 Sep 03 11:12 classes
>>>>> drwxr-sr-x   2 root     software        512 Sep 03 10:09 lib
>>>>> -rw-r--r--   1 root     software        328 Sep 03 14:22 web.xml
>>>>>
>>>>> jasonTest/WEB-INF/classes:
>>>>> total 8
>>>>> drwxr-sr-x   2 root     software        512 Sep 03 10:31 foo
>>>>>
>>>>> jasonTest/WEB-INF/classes/foo:
>>>>> total 8
>>>>> -rw-r-----   1 root     software        815 Sep 03 10:31 
>>>>> HelloWorld.class
>>>>>
>>>>> jasonTest/WEB-INF/lib:
>>>>> total 0
>>>>> neptune:root>
>>>>> =======================
>>>>>
>>>>> My web.xml looks like:
>>>>>
>>>>> <?xml version="1.0" encoding="ISO-8859-1"?>
>>>>>
>>>>> <!DOCTYPE web-app
>>>>>    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>>>>>    "http://java.sun.com/dtd/web-app_2_3.dtd">
>>>>>
>>>>> <web-app>
>>>>>
>>>>> <servlet>
>>>>>    <servlet-name>HelloWorld</servlet-name>
>>>>>    <servlet-class>/servlet/foo/HelloWorld</servlet-class>
>>>>> </servlet>
>>>>>
>>>>> </web-app>
>>>>>




RE: adding a servlet to my webapp

Posted by Schalk <sc...@volume4.co.za>.
Jason

<servlet>
        <servlet-name>HelloWorld</servlet-name>
        <servlet-class><!-- Over here you have to specify the complete path
to the servlet --> HelloWorld</servlet-class>
</servlet>

Kind Regards
Schalk Neethling
Volume4.Development.Multimedia.Branding
emotionalize.conceptualize.visualize.realize
Tel: +27125468436
Fax: +27125468436
email:schalk@volume4.co.za
web: www.volume4.co.za
 

:: -----Original Message-----
:: From: Jason Jesso [mailto:jjesso@global-matrix.com]
:: Sent: Wednesday, September 03, 2003 9:36 PM
:: To: Tomcat Users List
:: Subject: Re: adding a servlet to my webapp
:: 
:: My guess is that this is right then:
:: 
:: <?xml version="1.0" encoding="ISO-8859-1"?>
:: 
:: <!DOCTYPE web-app
::     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
::     "http://java.sun.com/dtd/web-app_2_3.dtd">
:: 
:: <web-app>
:: 
:: <servlet>
::         <servlet-name>HelloWorld</servlet-name>
::         <servlet-class>HelloWorld</servlet-class>
:: </servlet>
:: <servlet-mapping>
::         <servlet-name>HelloWorld</servlet-name>
::         <url-pattern>/servlet/foo/HelloWorld</url-pattern>
:: </servlet-mapping>
:: 
:: </web-app>
:: 
:: Do I need the "mypackage" thing?
:: 
:: With what I have above I get a "HTTP Status 500 -
:: 
:: root cause
:: 
:: java.lang.ClassNotFoundException: HelloWorld
:: 
:: 
:: 
:: 
:: 
:: 
:: Justin Ruthenbeck wrote:
:: 
:: > Jason,
:: >
:: > John was pointing out that you're missing the <servlet-mapping> which
:: > basically says, "For a URL that looks like X, send the request to
:: > servlet Y."  You've also got a malformed <servlet-class> value.
:: > Something like this should work...
:: >
:: > <servlet>
:: >         <servlet-name>HelloWorld</servlet-name>
:: >         <servlet-class>mypackage.HelloWorld</servlet-class>
:: > </servlet>
:: > <servlet-mapping>
:: >         <servlet-name>HelloWorld</servlet-name>
:: >         <url-pattern>/servlet/foo/HelloWorld</url-pattern>
:: > </servlet-mapping>
:: >
:: > justin
:: >
:: >
:: > At 12:02 PM 9/3/2003, you wrote:
:: >
:: >> But,  I don't want to use the "invoker".  I want to be able to
:: >> specify the servlet itself in web.xml.
:: >>
:: >> The invoker is "evil" according to the link you gave me.
:: >>
:: >>
:: >>
:: >> John Turner wrote:
:: >>
:: >>>
:: >>> You have to map your servlet in web.xml.
:: >>>
:: >>> FAQ: http://jakarta.apache.org/tomcat/faq/misc.html#invoker
:: >>>
:: >>> John
:: >>>
:: >>> Jason Jesso wrote:
:: >>>
:: >>>> When I go to my servlet I get "HTTP Status 404 -
:: >>>> /jasonTest/servlet/foo/HelloWorld"
:: >>>>
:: >>>> The url is:
:: >>>> http://neptune/jasonTest/servlet/foo/HelloWorld
:: >>>>
:: >>>> My config is as follows:  (What is wrong here??)
:: >>>>
:: >>>> I have a webapp defined in server.xml as
:: >>>>
:: >>>> =======================
:: >>>>       <Context path="/jasonTest"
:: >>>>            docBase="jasonTest"
:: >>>>            debug="0"
:: >>>>            reloadable="true"
:: >>>>            crossContext="true">
:: >>>>            <Logger
:: >>>> className="org.apache.catalina.logger.FileLogger"
:: >>>> prefix="jasonTest" suffix=".out"/>
:: >>>>        </Context>
:: >>>> =======================
:: >>>>
:: >>>>
:: >>>> My webapp directory structure looks like:
:: >>>> =======================
:: >>>> neptune:root> ls -lR jasonTest/
:: >>>> total 16
:: >>>> drwxr-sr-x   4 root     software        512 Sep 03 10:18 WEB-INF
:: >>>> -rw-r--r--   1 root     software         43 Sep 03 10:10 index.html
:: >>>> jasonTest/WEB-INF:
:: >>>> total 24
:: >>>> drwxr-sr-x   3 root     software        512 Sep 03 11:12 classes
:: >>>> drwxr-sr-x   2 root     software        512 Sep 03 10:09 lib
:: >>>> -rw-r--r--   1 root     software        328 Sep 03 14:22 web.xml
:: >>>>
:: >>>> jasonTest/WEB-INF/classes:
:: >>>> total 8
:: >>>> drwxr-sr-x   2 root     software        512 Sep 03 10:31 foo
:: >>>>
:: >>>> jasonTest/WEB-INF/classes/foo:
:: >>>> total 8
:: >>>> -rw-r-----   1 root     software        815 Sep 03 10:31
:: >>>> HelloWorld.class
:: >>>>
:: >>>> jasonTest/WEB-INF/lib:
:: >>>> total 0
:: >>>> neptune:root>
:: >>>> =======================
:: >>>>
:: >>>> My web.xml looks like:
:: >>>>
:: >>>> <?xml version="1.0" encoding="ISO-8859-1"?>
:: >>>>
:: >>>> <!DOCTYPE web-app
:: >>>>    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
:: >>>>    "http://java.sun.com/dtd/web-app_2_3.dtd">
:: >>>>
:: >>>> <web-app>
:: >>>>
:: >>>> <servlet>
:: >>>>    <servlet-name>HelloWorld</servlet-name>
:: >>>>    <servlet-class>/servlet/foo/HelloWorld</servlet-class>
:: >>>> </servlet>
:: >>>>
:: >>>> </web-app>
:: >>>>
:: >>>
:: >>>
:: >>>
:: >>> ---------------------------------------------------------------------
:: >>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
:: >>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
:: >>>
:: >>
:: >> --
:: >> <jason/>
:: >>
:: >>
:: >>
:: >>
:: >>
:: >> ---------------------------------------------------------------------
:: >> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
:: >> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
:: >
:: >
:: >
:: > ____________________________________
:: > Justin Ruthenbeck
:: > Software Engineer, NextEngine Inc.
:: > justinr - AT - nextengine DOT com
:: > Confidential
:: >    See http://www.nextengine.com/confidentiality.php
:: > ____________________________________
:: >
:: >
:: > ---------------------------------------------------------------------
:: > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
:: > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
:: >
:: >
:: 
:: --
:: <jason/>
:: 
:: 
:: 
:: 
:: 
:: ---------------------------------------------------------------------
:: To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
:: For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



Re: adding a servlet to my webapp

Posted by Jason Jesso <jj...@global-matrix.com>.
My guess is that this is right then:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

<servlet>
        <servlet-name>HelloWorld</servlet-name>
        <servlet-class>HelloWorld</servlet-class>
</servlet>
<servlet-mapping>
        <servlet-name>HelloWorld</servlet-name>
        <url-pattern>/servlet/foo/HelloWorld</url-pattern>
</servlet-mapping>

</web-app>

Do I need the "mypackage" thing?

With what I have above I get a "HTTP Status 500 -

root cause

java.lang.ClassNotFoundException: HelloWorld






Justin Ruthenbeck wrote:

> Jason,
>
> John was pointing out that you're missing the <servlet-mapping> which 
> basically says, "For a URL that looks like X, send the request to 
> servlet Y."  You've also got a malformed <servlet-class> value.  
> Something like this should work...
>
> <servlet>
>         <servlet-name>HelloWorld</servlet-name>
>         <servlet-class>mypackage.HelloWorld</servlet-class>
> </servlet>
> <servlet-mapping>
>         <servlet-name>HelloWorld</servlet-name>
>         <url-pattern>/servlet/foo/HelloWorld</url-pattern>
> </servlet-mapping>
>
> justin
>
>
> At 12:02 PM 9/3/2003, you wrote:
>
>> But,  I don't want to use the "invoker".  I want to be able to 
>> specify the servlet itself in web.xml.
>>
>> The invoker is "evil" according to the link you gave me.
>>
>>
>>
>> John Turner wrote:
>>
>>>
>>> You have to map your servlet in web.xml.
>>>
>>> FAQ: http://jakarta.apache.org/tomcat/faq/misc.html#invoker
>>>
>>> John
>>>
>>> Jason Jesso wrote:
>>>
>>>> When I go to my servlet I get "HTTP Status 404 - 
>>>> /jasonTest/servlet/foo/HelloWorld"
>>>>
>>>> The url is:
>>>> http://neptune/jasonTest/servlet/foo/HelloWorld
>>>>
>>>> My config is as follows:  (What is wrong here??)
>>>>
>>>> I have a webapp defined in server.xml as
>>>>
>>>> =======================
>>>>       <Context path="/jasonTest"
>>>>            docBase="jasonTest"
>>>>            debug="0"
>>>>            reloadable="true"
>>>>            crossContext="true">
>>>>            <Logger 
>>>> className="org.apache.catalina.logger.FileLogger" 
>>>> prefix="jasonTest" suffix=".out"/>
>>>>        </Context>
>>>> =======================
>>>>
>>>>
>>>> My webapp directory structure looks like:
>>>> =======================
>>>> neptune:root> ls -lR jasonTest/
>>>> total 16
>>>> drwxr-sr-x   4 root     software        512 Sep 03 10:18 WEB-INF
>>>> -rw-r--r--   1 root     software         43 Sep 03 10:10 index.html
>>>> jasonTest/WEB-INF:
>>>> total 24
>>>> drwxr-sr-x   3 root     software        512 Sep 03 11:12 classes
>>>> drwxr-sr-x   2 root     software        512 Sep 03 10:09 lib
>>>> -rw-r--r--   1 root     software        328 Sep 03 14:22 web.xml
>>>>
>>>> jasonTest/WEB-INF/classes:
>>>> total 8
>>>> drwxr-sr-x   2 root     software        512 Sep 03 10:31 foo
>>>>
>>>> jasonTest/WEB-INF/classes/foo:
>>>> total 8
>>>> -rw-r-----   1 root     software        815 Sep 03 10:31 
>>>> HelloWorld.class
>>>>
>>>> jasonTest/WEB-INF/lib:
>>>> total 0
>>>> neptune:root>
>>>> =======================
>>>>
>>>> My web.xml looks like:
>>>>
>>>> <?xml version="1.0" encoding="ISO-8859-1"?>
>>>>
>>>> <!DOCTYPE web-app
>>>>    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>>>>    "http://java.sun.com/dtd/web-app_2_3.dtd">
>>>>
>>>> <web-app>
>>>>
>>>> <servlet>
>>>>    <servlet-name>HelloWorld</servlet-name>
>>>>    <servlet-class>/servlet/foo/HelloWorld</servlet-class>
>>>> </servlet>
>>>>
>>>> </web-app>
>>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>
>>
>> -- 
>> <jason/>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
> ____________________________________
> Justin Ruthenbeck
> Software Engineer, NextEngine Inc.
> justinr - AT - nextengine DOT com
> Confidential
>    See http://www.nextengine.com/confidentiality.php
> ____________________________________
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>

-- 
<jason/>





Re: adding a servlet to my webapp

Posted by Justin Ruthenbeck <ju...@nextengine.com>.
Jason,

John was pointing out that you're missing the <servlet-mapping> which 
basically says, "For a URL that looks like X, send the request to servlet 
Y."  You've also got a malformed <servlet-class> value.  Something like 
this should work...

<servlet>
         <servlet-name>HelloWorld</servlet-name>
         <servlet-class>mypackage.HelloWorld</servlet-class>
</servlet>
<servlet-mapping>
         <servlet-name>HelloWorld</servlet-name>
         <url-pattern>/servlet/foo/HelloWorld</url-pattern>
</servlet-mapping>

justin


At 12:02 PM 9/3/2003, you wrote:
>But,  I don't want to use the "invoker".  I want to be able to specify the 
>servlet itself in web.xml.
>
>The invoker is "evil" according to the link you gave me.
>
>
>
>John Turner wrote:
>
>>
>>You have to map your servlet in web.xml.
>>
>>FAQ: http://jakarta.apache.org/tomcat/faq/misc.html#invoker
>>
>>John
>>
>>Jason Jesso wrote:
>>
>>>When I go to my servlet I get "HTTP Status 404 - 
>>>/jasonTest/servlet/foo/HelloWorld"
>>>
>>>The url is:
>>>http://neptune/jasonTest/servlet/foo/HelloWorld
>>>
>>>My config is as follows:  (What is wrong here??)
>>>
>>>I have a webapp defined in server.xml as
>>>
>>>=======================
>>>       <Context path="/jasonTest"
>>>            docBase="jasonTest"
>>>            debug="0"
>>>            reloadable="true"
>>>            crossContext="true">
>>>            <Logger className="org.apache.catalina.logger.FileLogger" 
>>> prefix="jasonTest" suffix=".out"/>
>>>        </Context>
>>>=======================
>>>
>>>
>>>My webapp directory structure looks like:
>>>=======================
>>>neptune:root> ls -lR jasonTest/
>>>total 16
>>>drwxr-sr-x   4 root     software        512 Sep 03 10:18 WEB-INF
>>>-rw-r--r--   1 root     software         43 Sep 03 10:10 index.html
>>>jasonTest/WEB-INF:
>>>total 24
>>>drwxr-sr-x   3 root     software        512 Sep 03 11:12 classes
>>>drwxr-sr-x   2 root     software        512 Sep 03 10:09 lib
>>>-rw-r--r--   1 root     software        328 Sep 03 14:22 web.xml
>>>
>>>jasonTest/WEB-INF/classes:
>>>total 8
>>>drwxr-sr-x   2 root     software        512 Sep 03 10:31 foo
>>>
>>>jasonTest/WEB-INF/classes/foo:
>>>total 8
>>>-rw-r-----   1 root     software        815 Sep 03 10:31 HelloWorld.class
>>>
>>>jasonTest/WEB-INF/lib:
>>>total 0
>>>neptune:root>
>>>=======================
>>>
>>>My web.xml looks like:
>>>
>>><?xml version="1.0" encoding="ISO-8859-1"?>
>>>
>>><!DOCTYPE web-app
>>>    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>>>    "http://java.sun.com/dtd/web-app_2_3.dtd">
>>>
>>><web-app>
>>>
>>><servlet>
>>>    <servlet-name>HelloWorld</servlet-name>
>>>    <servlet-class>/servlet/foo/HelloWorld</servlet-class>
>>></servlet>
>>>
>>></web-app>
>>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>
>--
><jason/>
>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


____________________________________
Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential
    See http://www.nextengine.com/confidentiality.php
____________________________________


Re: adding a servlet to my webapp

Posted by John Turner <to...@johnturner.com>.
Yes, exactly.

The way you have it now is trying to use the Invoker servlet.

You are missing the servlet mapping in web.xml, as explained in option 
#3 of this post which is linked from the FAQ section:

http://marc.theaimsgroup.com/?l=tomcat-user&m=103945394724196&w=2

John

Jason Jesso wrote:

> But,  I don't want to use the "invoker".  I want to be able to specify 
> the servlet itself in web.xml.
> 
> The invoker is "evil" according to the link you gave me.
> 
> 
> 
> John Turner wrote:
> 
>>
>> You have to map your servlet in web.xml.
>>
>> FAQ: http://jakarta.apache.org/tomcat/faq/misc.html#invoker
>>
>> John
>>
>> Jason Jesso wrote:
>>
>>> When I go to my servlet I get "HTTP Status 404 - 
>>> /jasonTest/servlet/foo/HelloWorld"
>>>
>>> The url is:
>>> http://neptune/jasonTest/servlet/foo/HelloWorld
>>>
>>> My config is as follows:  (What is wrong here??)
>>>
>>> I have a webapp defined in server.xml as
>>>
>>> =======================
>>>       <Context path="/jasonTest"
>>>            docBase="jasonTest"
>>>            debug="0"
>>>            reloadable="true"
>>>            crossContext="true">
>>>            <Logger className="org.apache.catalina.logger.FileLogger" 
>>> prefix="jasonTest" suffix=".out"/>
>>>        </Context>
>>> =======================
>>>
>>>
>>> My webapp directory structure looks like:
>>> =======================
>>> neptune:root> ls -lR jasonTest/
>>> total 16
>>> drwxr-sr-x   4 root     software        512 Sep 03 10:18 WEB-INF
>>> -rw-r--r--   1 root     software         43 Sep 03 10:10 index.html
>>> jasonTest/WEB-INF:
>>> total 24
>>> drwxr-sr-x   3 root     software        512 Sep 03 11:12 classes
>>> drwxr-sr-x   2 root     software        512 Sep 03 10:09 lib
>>> -rw-r--r--   1 root     software        328 Sep 03 14:22 web.xml
>>>
>>> jasonTest/WEB-INF/classes:
>>> total 8
>>> drwxr-sr-x   2 root     software        512 Sep 03 10:31 foo
>>>
>>> jasonTest/WEB-INF/classes/foo:
>>> total 8
>>> -rw-r-----   1 root     software        815 Sep 03 10:31 
>>> HelloWorld.class
>>>
>>> jasonTest/WEB-INF/lib:
>>> total 0
>>> neptune:root>
>>> =======================
>>>
>>> My web.xml looks like:
>>>
>>> <?xml version="1.0" encoding="ISO-8859-1"?>
>>>
>>> <!DOCTYPE web-app
>>>    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>>>    "http://java.sun.com/dtd/web-app_2_3.dtd">
>>>
>>> <web-app>
>>>
>>> <servlet>
>>>    <servlet-name>HelloWorld</servlet-name>
>>>    <servlet-class>/servlet/foo/HelloWorld</servlet-class>
>>> </servlet>
>>>
>>> </web-app>
>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
> 



Re: adding a servlet to my webapp

Posted by Jason Jesso <jj...@global-matrix.com>.
But,  I don't want to use the "invoker".  I want to be able to specify 
the servlet itself in web.xml.

The invoker is "evil" according to the link you gave me.



John Turner wrote:

>
> You have to map your servlet in web.xml.
>
> FAQ: http://jakarta.apache.org/tomcat/faq/misc.html#invoker
>
> John
>
> Jason Jesso wrote:
>
>> When I go to my servlet I get "HTTP Status 404 - 
>> /jasonTest/servlet/foo/HelloWorld"
>>
>> The url is:
>> http://neptune/jasonTest/servlet/foo/HelloWorld
>>
>> My config is as follows:  (What is wrong here??)
>>
>> I have a webapp defined in server.xml as
>>
>> =======================
>>       <Context path="/jasonTest"
>>            docBase="jasonTest"
>>            debug="0"
>>            reloadable="true"
>>            crossContext="true">
>>            <Logger className="org.apache.catalina.logger.FileLogger" 
>> prefix="jasonTest" suffix=".out"/>
>>        </Context>
>> =======================
>>
>>
>> My webapp directory structure looks like:
>> =======================
>> neptune:root> ls -lR jasonTest/
>> total 16
>> drwxr-sr-x   4 root     software        512 Sep 03 10:18 WEB-INF
>> -rw-r--r--   1 root     software         43 Sep 03 10:10 index.html
>> jasonTest/WEB-INF:
>> total 24
>> drwxr-sr-x   3 root     software        512 Sep 03 11:12 classes
>> drwxr-sr-x   2 root     software        512 Sep 03 10:09 lib
>> -rw-r--r--   1 root     software        328 Sep 03 14:22 web.xml
>>
>> jasonTest/WEB-INF/classes:
>> total 8
>> drwxr-sr-x   2 root     software        512 Sep 03 10:31 foo
>>
>> jasonTest/WEB-INF/classes/foo:
>> total 8
>> -rw-r-----   1 root     software        815 Sep 03 10:31 
>> HelloWorld.class
>>
>> jasonTest/WEB-INF/lib:
>> total 0
>> neptune:root>
>> =======================
>>
>> My web.xml looks like:
>>
>> <?xml version="1.0" encoding="ISO-8859-1"?>
>>
>> <!DOCTYPE web-app
>>    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>>    "http://java.sun.com/dtd/web-app_2_3.dtd">
>>
>> <web-app>
>>
>> <servlet>
>>    <servlet-name>HelloWorld</servlet-name>
>>    <servlet-class>/servlet/foo/HelloWorld</servlet-class>
>> </servlet>
>>
>> </web-app>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>

-- 
<jason/>





Re: adding a servlet to my webapp

Posted by John Turner <to...@johnturner.com>.
You have to map your servlet in web.xml.

FAQ: http://jakarta.apache.org/tomcat/faq/misc.html#invoker

John

Jason Jesso wrote:

> When I go to my servlet I get "HTTP Status 404 - 
> /jasonTest/servlet/foo/HelloWorld"
> 
> The url is:
> http://neptune/jasonTest/servlet/foo/HelloWorld
> 
> My config is as follows:  (What is wrong here??)
> 
> I have a webapp defined in server.xml as
> 
> =======================
>       <Context path="/jasonTest"
>            docBase="jasonTest"
>            debug="0"
>            reloadable="true"
>            crossContext="true">
>            <Logger className="org.apache.catalina.logger.FileLogger" 
> prefix="jasonTest" suffix=".out"/>
>        </Context>
> =======================
> 
> 
> My webapp directory structure looks like:
> =======================
> neptune:root> ls -lR jasonTest/
> total 16
> drwxr-sr-x   4 root     software        512 Sep 03 10:18 WEB-INF
> -rw-r--r--   1 root     software         43 Sep 03 10:10 index.html
> jasonTest/WEB-INF:
> total 24
> drwxr-sr-x   3 root     software        512 Sep 03 11:12 classes
> drwxr-sr-x   2 root     software        512 Sep 03 10:09 lib
> -rw-r--r--   1 root     software        328 Sep 03 14:22 web.xml
> 
> jasonTest/WEB-INF/classes:
> total 8
> drwxr-sr-x   2 root     software        512 Sep 03 10:31 foo
> 
> jasonTest/WEB-INF/classes/foo:
> total 8
> -rw-r-----   1 root     software        815 Sep 03 10:31 HelloWorld.class
> 
> jasonTest/WEB-INF/lib:
> total 0
> neptune:root>
> =======================
> 
> My web.xml looks like:
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> 
> <!DOCTYPE web-app
>    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>    "http://java.sun.com/dtd/web-app_2_3.dtd">
> 
> <web-app>
> 
> <servlet>
>    <servlet-name>HelloWorld</servlet-name>
>    <servlet-class>/servlet/foo/HelloWorld</servlet-class>
> </servlet>
> 
> </web-app>
> 
> 



problems with different tomcat-axis

Posted by Webmaster <we...@gymgest.it>.
hi to all,
I've a big inknown problem.
I'm developing a web application with a VB-SOAP client.
I'm using some java servlet in tomcat-axis.
I have a LAN for testing my web application. It's all ok: any PC with 
tomcat running working fine.
Any PC with my VBclient communicate with the current tomcat running. (All 
under windows).

Now, I'va built a web server, mount in my provider, with linux, tomcat and 
axis.
I've upload on this server my context "axis" and my web app, under 
var/tomcac4/webapps....
but my VBclient, on my PC, doesn't communicate with the remote application.

I don't know about this! The error occourred is (in VB): WSDLReader: 
XMLParse error....

bou i've installed all the necessary library on my PC, instead the MSSOAP 
Toolkit....

It may be a problem of versions?

I'm also a newbie for using linux and line command-compiling (to trying it 
on the server...).
I haven't found anything about this error on Internet, my description is in 
Italina, but can be translate in "Impossible to find the specific resource".

thank to all,

Tiziana