Not sure if this should be here or in the XML forum, so feel free to move it if need be. I just loaded Tomcat today, gotten a couple of servlets to run just fine. However, I added some params to web.xml, to play with getting ServletConfig params. When I use the modified xml file, I can't even get localhost:8080 to pull up, get the 404 error. If I use the old xml file, things work fine. Here's the modified xml file
If you've read Core Servlets and JSP, then you should recognize this, it's pulled directly from the book, which is why I'm confused as to why this problem is occuring. Never done any xml stuff, so I have no idea where to begin. Jason
I'm having this problem and tried a lot of thing already, my web.xml file looks like this <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/dtd/web-app_2_2.dtd"> <web-app> <servlet> <servlet-name>ShowMsg</servlet-name> <servlet-class>coreservlets.ShowMessage</servlet-class> <init-param> <param-name>message</param-name> <param-value>ahahahaha</param-value> </init-param> <init-param> <param-name>repeats</param-name> <param-value>5</param-value> </init-param> </servlet>
</web-app> And it still doesn't work. Can anyone help?
"doesn't work" is not quite enough information to go on - there are so many things that can go wrong with a servlet, we need more clues. 1. How are you trying to address the servlet? 2. What happens next? 3. Do the Tomcat logs show any clues? 4. Does your servlet init() method do a System.out.println("some message") to verify that the servlet is even being called? Bill