tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Larsen" <lar...@qec.com>
Subject Re: Simple Question (I hope...)
Date Fri, 05 Apr 2002 18:08:10 GMT
Could be several things.  Since some details about your setup are,
missing, please don't take offense if I state the obvious.

Are you using Tomcat standalone or with Apache? Have you successfully
gotten the Tomcat examples to work?

If your homepage.class has a 'package' directive in the source, then
you need to reference the fully qualified class name in your web.xml
and your class file needs to be in the proper package subdirectories
under WEB-INF/classes.

Check the Tomcat logs. You should see some messages that reference
your [/test] context if Tomcat is successfully deploying the context.

Add  <load-on-startup>1</load-on-startup> to your web.xml. Restart
Tomcat and if you class is being successfully loaded you should
see "greetings: init" in the log.

If your servlet is successfully loaded, then it's a URL problem.

What URL are you using to test the servlet? According to your setup
it should be http://hostname:{port}/test/please assuming you are using
Tomcat as your webserver, otherwise the URL mapping is dependent upon
your Apache config.

I hope these ideas help... Post more details if not.

Jeff


----- Original Message -----
From: "Sefton, Adam" <Adam.Sefton@plc.cwplc.com>
To: "'Tomcat Users List'" <tomcat-user@jakarta.apache.org>
Sent: Friday, April 05, 2002 10:29 AM
Subject: Simple Question (I hope...)


> Hi there,
>
> I'm new to Tomcat and to this list, so apologies if this question has already been asked
(I've checked the archives and can't find an answer).
>
> I'm trying to create a new context in server.xml. My current code is:
>
> <Context path="/test" docBase="test"
> debug="0" reloadable="true" />
>
> I've also created a directory within webapps called "test", with sub directory WEB-INF
and classes.  And within the classes folder is my test class file ("homepage.class").
>
> I've also created a web.xml file and placed it in the WEB-INF directory defining the
servlet mappings for the new servlet (called "homepage"):
>
> <web-app>
>   <servlet>
>   <servlet-name>greetings</servlet-name>
>   <servlet-class>homepage</servlet-class>
>   </servlet>
>   <servlet-mapping>
>     <servlet-name>greetings</servlet-name>
>      <url-pattern>/test/please</url-pattern>
>   </servlet-mapping>
>
> </web-app>
>
> Using the manager app I've successfully added a new application (called "test") but when
I try to view the servlet, I get a 404 error ... any idea what I'm doing wrong?
>
> Thanks
>
> Adam Sefton
> Applications Developer
>
>
> **********************************************************************
> This message may contain information which is confidential or privileged.
> If you are not the intended recipient, please advise the sender immediately
> by reply e-mail and delete this message and any attachments
> without retaining a copy.
>
> **********************************************************************
>
>
> --
> 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