RE: simple HelloWorld example - 404

2004-07-20 Thread Shapira, Yoav

Hi,
Good answer -- and it's gratifying to see formerly new/novice users now
helping others ;)

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED]
Sent: Monday, July 19, 2004 6:15 PM
To: Tomcat Users List
Subject: Re: simple HelloWorld example - 404

From: Scott D. Anderson [EMAIL PROTECTED]
 when I click on the link to servlet/HelloWorld I get a 404.

Examples with /servlet/ in the URL usually depend upon the Invoker
Servlet
being enabled.  It is now disabled by default, and although it's more
frustrating in the beginning, it's better to leave it that way and
learn to
configure your Servlets.

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

 Anyone have any ideas on how to get this very simple example working?

Put servlet and servlet-mapping tags into web.xml, and then access
the
Servlet using the URL that you configured, NOT the one with /servlet/
in
it.
Check the DTD for the required order of tags in web.xml.

--
Wendy Smoak


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: simple HelloWorld example - 404

2004-07-19 Thread Schalk Neethling
Where is your web.xml located? And if it is located inside foo/WEB-INF/ 
then have you tried accessing the servlet when you remove the web.xml?

Scott D. Anderson wrote:
I'm a novice and I'm working through the Tomcat documentation.  
(I'm using Tomcat 5.)  I've gotten to step 3, 

http://localhost:8080/tomcat-docs/appdev/deployment.html
I'd previously compiled the HelloWorld example from the O'Reilly book on 
Java Servlet Programming by Hunter.  I then wanted to run it from the 
browser, so I set up something like the servlets-examples that also has a
HelloWorldExample, so I did the following:

1. created a foo directory under $CATALINA_HOME/webapps
2. created a WEB-INF directory under foo
3. created a classes directory under WEB-INF
4. copied the HelloWorld.java and HelloWorld.class files to
the classes directory and made them world readable.
5. chmod all directories 755
6. created a web.xml file from tomcat-docs/appdev/web.xml.txt
7. created an index.html file under foo that has a hyperref to 
servlet/HelloWorld
8. restarted Tomcat

I checked the log files and I've eliminated the parsing errors for the
web.xml file.  I'm able to visit the index.html file, but when I click on
the
link to servlet/HelloWorld I get a 404. 

Note that the web.xml.txt file says that I should be able to execute my
servlet just by accessing localhost:8080/foo/servlet/HelloWorld, yet I'm 
not able to do so.  I think that means that the problem isn't in my web.xml
file (even though that's the most complicated and error-prone step).

I also tried putting the HelloWorld.* files in
webapps/ROOT/WEB-INF/classes,
as directed in the Hunter book, but that didn't work either (404).
Anyone have any ideas on how to get this very simple example working?
Thanks,
Scott
--
Scott D. Anderson
Computer Science Department
Wellesley College
[EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Development.Multimedia.Branding
emotionalize.conceptualize.visualize.realize
Tel: +27125468436
Fax: +27125468436
email:[EMAIL PROTECTED]
web: www.volume4.co.za
This message contains information that is considered to be sensitive or confidential 
and may not be forwarded or disclosed to any other party without the permission of the 
sender. If you received this message in error, please notify me immediately so that I 
can correct and delete the original email. Thank you.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: simple HelloWorld example - 404

2004-07-19 Thread Wendy Smoak
From: Scott D. Anderson [EMAIL PROTECTED]
 when I click on the link to servlet/HelloWorld I get a 404.

Examples with /servlet/ in the URL usually depend upon the Invoker Servlet
being enabled.  It is now disabled by default, and although it's more
frustrating in the beginning, it's better to leave it that way and learn to
configure your Servlets.

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

 Anyone have any ideas on how to get this very simple example working?

Put servlet and servlet-mapping tags into web.xml, and then access the
Servlet using the URL that you configured, NOT the one with /servlet/ in it.
Check the DTD for the required order of tags in web.xml.

-- 
Wendy Smoak


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]