• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Problems with JAVA webserver 2.0

 
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
-------------------------------------------------------------

 
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


 
If you live in a cold climate and on the grid, incandescent light can use less energy than LED. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic