I'm plowing through Head First Servlets and JSP, but I'm having a hard time getting Tomcat to work.
Whenever I go to test a new web app on localhost, I always get the dreaded "the requested resource is not available" error report. I just want it to open a simple html file in the browser. In the webapps folder in the tomcat directory, I have a "beer" directory with a WEB-INF folder and an html file one level in. In my browser, I type in http://localhost:8080/beer/form.html which should open fine.
I have tomcat 6 and the context element in the Catalina manager file has the reloadable attribute set to true.
This is rather frustrating. My directories are right and my case is right and, yes, tomcat is running. I do reset the service everytime I make a change.
It's weird because all my practice apps did this at first too, but they randomly start working after awhile.
That doesn't actually tell us anything about the actual structure of your files--be specific.
If your HTML file is under WEB-INF, you won't be able to access it--the client cannot directly access anything under WEB-INF.
I do reset the service everytime I make a change.
posted 10 years ago
I have a WEB-INF folder and an html file in the same folder.
I have my html file and my WEB-INF folder in the first level in. In WEB-INF, I have my web.xml dd file, an empty lib folder and the package directory for my class files (classes/com/examples/web and classes/com/examples/model).
I just assumed that anytime you make a change you should stop and restart the service.
Actually, I haven't quite gotten to the actual server pages yet.
What are the usual common problems with that requested resource error? It's done it with sll my web apps so far, but I somehow (I don't know how) got them to work. I'm thinking it's some common newbie detail I keep forgetting.
How about posting the stack trace? Doesn't it *say* what the error is?
posted 10 years ago
I found the issue.
Apparently it was my charset. I was using ISO, but all I did was switch to UTF-8. It works now. Why would that matter though.
By the way, to the authors of the Head First series, amazing job on these books. Everything is explained so well and the old asian martial art references, while somewhat awkward, admittedly are funny and helpful. Five stars!
Thank you for your help guys. Those logs should come in handy.