Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with JAVA webserver 2.0

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
take the "s" off "servlets", like this:
http://localhost:8080/servlet/test where test is the servlet's name.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
-------------------------------------------------------------
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic