• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Web Server not finding *.java servlet files

 
Art Metzer
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.
I have downloaded and am attempting to use Java Web Server 2.0 locally on my machine. Where in the file hierarchy do I save my *.java servlet files so that the servlets are compiled and execute when I bring them up in my browser?
My servlet's source code is called BasicServlet.java. I saved this source code in my C:\JavaWebServer2.0\servlets folder. I fired up Java Web Server's http daemon, and I successfully set port 8080's Web service to "Running". But when I go to my browser and type in "http://localhost:8080/servlet/BasicServlet", I get a 404, "Not Found".
Have I skipped a step? Please advise.
Thank you,
Art
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I am reading your problem correctly and forgive if I have, You need to compile your .java to a .class file.
javac BasicServlet.java
and put the class file in the servlet directory
Hope This Helps
 
Art Metzer
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Carl.
Ah, now we are getting somewhere.
Now, the problem is: javax.servlet.* and javax.servlet.http.* are not part of the standard SDK. How do I compile *.java files if these Java extensions are not part of the SDK?
I should also mention I have been searching for a suitable Web server program that can handle servlets as I learn about them in books, and I have not been having luck overall. I tried using Resin at http://www.caucho.com, but it will not process server-side includes. I've tried to use Java Web Server, but it doesn't appear to automatically and successfully compile Java source into Java bytecode the way Resin would: JWS introduces a second step, compile off-line then load the class. I didn't have much luck with Jigsaw, either. I feel a bit at sea....if anyone could recommend a good servlet book for a beginner AND an appropriate Web server program to accompany said book, I would be grateful.
Thank you.
Art
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They are part of the J2EE. Try downloading that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic