This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Problems with JAVA webserver 2.0
 
Similar Threads
unable to find url
Error 404
servlet not found error
tomcat can't find servlet
servlets - database