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 Problems with JAVA webserver 2.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problems with JAVA webserver 2.0" Watch "Problems with JAVA webserver 2.0" New topic
Author

Problems with JAVA webserver 2.0

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I have downloaded the trial version of javawebserver2.0. I coded a small servlet test in c:\javawebserver2.0\servlets directory and compiled it and put the class file in the same directory. After starting the server i tried to run the servlet by
http://127.0.0.1:8080/servlets/test
and i was getting a status coded of 404 Requested URL not found.
Can any one help me in this regard.
Also can any one tell me how to code servlets (Which directory) in javawebserver2.0 and where the class file has to be.
Thanks a bunch
Chandar
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
take the "s" off "servlets", like this:
http://localhost:8080/servlet/test where test is the servlet's name.
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
-------------------------------------------------------------
i think your URL should be http://localhost:8080/servlet/test
-------------------------------------------------------------
put your servlet i.e .class files in servlet directory only.
-------------------------------------------------------------
if you put your .class files in example directory then your
URL will be http;//localhost:8080/test only
-------------------------------------------------------------

Rajendar
Greenhorn

Joined: Feb 28, 2002
Posts: 9
once u wrote servlet and placed in servlets directory,u need to access it by http://127.0.0.1:8080/servlet/test and not by
http://127.0.0.1:8080/servlets/test.it is because servlets is a directory and each is a independent servlet in that directory.so
access by servlet and not by servlets in its URL

Originally posted by chandarv:
I have downloaded the trial version of javawebserver2.0. I coded a small servlet test in c:\javawebserver2.0\servlets directory and compiled it and put the class file in the same directory. After starting the server i tried to run the servlet by
http://127.0.0.1:8080/servlets/test
and i was getting a status coded of 404 Requested URL not found.
Can any one help me in this regard.
Also can any one tell me how to code servlets (Which directory) in javawebserver2.0 and where the class file has to be.
Thanks a bunch
Chandar


Raj
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems with JAVA webserver 2.0