This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
I think root is something like a root application to Tomcat. If you put any page i.e. html/jsp in that directory or any other subdirectory of ROOT, it'll be accessible because no mapping is required. Please understand that you've not created a new web application by creating a directory under root. You have to have your directory under webapps and not under root i.e. at the same level as root.
You've also noticed that under root, there is a dir. called web-inf. So, root is a kind of web application and you need to create your own if you want to test anything. You can use root itself but then for deploying such servlets, you need to put the servlet classes under web-inf folder of ROOT and add the entries to the web.xml under that same.
I hope I've solved your problem!
Work Hard, Expect The Worst...<br /> <br />Bimal R. Patel<br />(SCJP 1.2, SCWCD 1.4)
Joined: Feb 04, 2006
But when I created a directory at the same level as roots under webapps,
Nothing is working. It is so frustrating . Is there any way to findout what is going wrong. I dont think the container is able to read the web.xml file.
Any help is highly appreciated.
Joined: Feb 04, 2006
Hi Bimal Patel,
Actually I was wrong. It worked when I placed my directory in webapps. I should have used webapps for my web application.
By the way, how to debug the servlets. Heard about log files. Where can I find them?
Any other techniques to debug......
Thanks for your help.
Joined: Aug 29, 2003
Your welcome! I know such kind of troubls while you're in the initial stages of learning servlets/jsp and web application fundamentals.
For debugging servlets, you can do that by remote debugging with any of the IDEs available. I would strongly suggest Eclipse. It is totally free and you can find the help with remote debugging from net. Let me know if I can help much.
I know I sound like a broken record on this, but IMHO all classes used in servlets should be in a package. The directory structure under WEB-INF/classes must reflect the package structure. Not using a package can result in strange and hard to debug problems. Older servlet references may not emphasize this. See also the "invoker" servlet FAQ here at the ranch. Bill