File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Servlets.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlets.." Watch "Servlets.." New topic
Author

Servlets..

Chuck Meduri
Ranch Hand

Joined: Nov 29, 2000
Posts: 48
Hi,
I am new to Servlets and trying to learn this topic along with JSP. I have downloaded the Servlet 2.3 specification and I assume the JSP 1.2 comes along with it. I have also downloaded the Tomcat 3.1,3.2 and 4.0 versions. I have the Core Servlets and Java Server Pages book by Marty Hall. I have been trying to set up the Tomcat by following the book but haven't been sucessful at all. I copied the Hello World servlet program and tried executing it, but it gives me Http error code of 405. This is after setting up the Tomact 3.1 version. Could somebody help me with installation of the Tomcat(latest version would be good) and why I am getting this error?
Thank you very much,
Chuck
David Li
Greenhorn

Joined: Nov 23, 2000
Posts: 16
If you think the tomcat setting is correct, you should make sure that the class you compiled was in the right folder under webapps then web-inf then classes.
Chuck Meduri
Ranch Hand

Joined: Nov 29, 2000
Posts: 48
Originally posted by David Li:
If you think the tomcat setting is correct, you should make sure that the class you compiled was in the right folder under webapps then web-inf then classes.

The class that I compiled is under webapps\web-inf\classes as described in the text book that I mentioned in my question.
P SOLAIAPPAN
Ranch Hand

Joined: Oct 20, 2000
Posts: 68
hi,
For Tomcat 3.2 keep your html & jsp files in
"D:\jakarta-tomcat\webapps\ROOT" directory (here my installation dir is "d:\jakarta-tomcat" )
to run html/jsp file.
"http://localhost:8080/Hello.jsp "
or
"http://localhost:8080/Hello.jsp "

To run servlets keep your compiled servlets files in
"D:\jakarta-tomcat\webapps\ROOT\WEB-INF\classes" dir
To run "Hello.class" (servlet file)
"http://localhost:8080/servlet/Hello "
solaiappan
Chuck Meduri
Ranch Hand

Joined: Nov 29, 2000
Posts: 48
Originally posted by P SOLAIAPPAN:
hi,
For Tomcat 3.2 keep your html & jsp files in
"D:\jakarta-tomcat\webapps\ROOT" directory (here my installation dir is "d:\jakarta-tomcat" )
to run html/jsp file.
"http://localhost:8080/Hello.jsp "
or
"http://localhost:8080/Hello.jsp "

To run servlets keep your compiled servlets files in
"D:\jakarta-tomcat\webapps\ROOT\WEB-INF\classes" dir
To run "Hello.class" (servlet file)
"http://localhost:8080/servlet/Hello "
solaiappan

I typed in http://localhost/servlet/HelloWorld which is the name of my servlet just like it was descibed in the book.
Any other suggestions would be appreciated
Thank you,
Chuck
Noah Carroll
Ranch Hand

Joined: Sep 20, 2000
Posts: 96
It is very important the you type :8080 after localhost. If not, then it will not work. However, I have heard that if you change the port number in your server.xml file from 8080 to just 80 it will work as http://localhost/servlet/ServletName
------------------
I hope its helps, feel free to email me noahcarroll@juno.com
[This message has been edited by Noah Carroll (edited November 30, 2000).]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Servlets..
 
Similar Threads
Problem accessing servlet through Tomcat 5.0.28
Developing Java Web Services with AXIS, Tomcat,
Tomcat Problem
Need help getting servlet software working
Tomcat 5.0.28 won't play with my servlet =(