wood burning stoves 2.0*
The moose likes Servlets and the fly likes Java Web Server not finding *.java servlet files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Java Web Server not finding *.java servlet files" Watch "Java Web Server not finding *.java servlet files" New topic
Author

Java Web Server not finding *.java servlet files

Art Metzer
Ranch Hand

Joined: Oct 31, 2000
Posts: 241
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

Joined: Jun 13, 2000
Posts: 3340
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


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Art Metzer
Ranch Hand

Joined: Oct 31, 2000
Posts: 241
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

Joined: May 05, 2000
Posts: 13974
They are part of the J2EE. Try downloading that.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Web Server not finding *.java servlet files