This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Hello Friends, I was wondering if you could help me understand an area of javaservlets thats causing me some confusion, specifically, a servlet in a package that uses parameters in the web.xml file. Some info first: Im using Tomcat 4.0.3 with J2SE 1.4. The Servlet container is configured to run on port 80. Ive just started using Java Servlets, and Im working through Marty Halls book "CoreServlets and Java Server pages" Im trying to understand the example in Chapter 2 of the book where a Servlet called ShowMessages reads paramters from the web.xml file. The ShowMessages class is a part of the coreservlets package. I can normally access servlets that are in the coreservlet package by accessing http://localhost/servlet/coreservlets.<MyServletClass> where <MyServletClass> is any Servlet class in the coreservlets package. Now if I run the ShowMessage servlet on http://localhost/servlet/coreservlets.ShowMessage The servlet is run, but no parameters are loaded. If I just run http://localhost/servlet/ShowMessage The servlet is run, and the parameters in the web.xml file are read. For the sake of typing, the ShowMessage.java and the web.xml files are exactly the same as that in the coreservlets book. Any explanation would be greatly appreciated Mark
is that with this URL, the servlet container finds the servlet without going through the web.xml data at all. This is a mode of operation that is left over from earlier servlet APIs - before Sun laid down the law about the use of web.xml for configuring servlets. Bill