File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Java Web Server not finding *.java servlet files

Art Metzer
Ranch Hand

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

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.
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, 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.
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:
subject: Java Web Server not finding *.java servlet files
It's not a secret anymore!