This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
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
posted
0
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
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