Hi, Ive been trying to get a servlet working on tomcat 4.1.18. (basically trying desperatley to upgrade from 3.2.1 to see if any perfomrnace gain) My problem is that tomcat will now startup itself and display jsp pages and htm pages in the examples folder. I need to add another folder. In tomcat 3.2.1, I edited the server.xml to include an additional context like: <!--derrick added this line <Context path="/intranettv" docBase="D:\intranettv\admin\public_site" debug="0" reloadable="true" crossContext="false"> </Context>--> Then all i had to do was go to localhost:8888/intranettv/+class¶ms When i try to add this context to tomcat 4.1.18 server.xml it goes a bit mental and complains about parser errors in web.xml Do i also have to change web.xml somewhere else?? What do I have to do from this point to get the tomcat to recognise where the servlet is stored and where to put a pointer to the initial servlet class!! Help please! ps the old Web.inf for tomcat 3.2.1 looked like this. Does this need to be changed for tomcat 4.1.18 <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"> <web-app> <display-name>IntranetTV</display-name> <description> Guide </description> <servlet> <servlet-name>IntranetTV</servlet-name> <servlet-class>com.bt.intranettv.view.IntranetTV</servlet-class> <init-param> <param-name>root</param-name> <param-value>D:\intranettv\admin\public_site\</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>IntranetTV</servlet-name> <url-pattern>/IntranetTV</url-pattern> </servlet-mapping> <servlet> <servlet-name>ManageContent</servlet-name> <servlet-class>com.bt.intranettv.admin.ManageContent</servlet-class> <init-param> <param-name>root</param-name> <param-value>D:\intranettv\admin\public_site\</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>ManageContent</servlet-name> <url-pattern>/ManageContent</url-pattern> </servlet-mapping> </web-app> [ February 10, 2003: Message edited by: tradester amagio ]
When i try to add this context to tomcat 4.1.18 server.xml it goes a bit mental and complains about parser errors in web.xml
It would help to know what the exact error is. If you've got a tag out of place, it should say that.
At first glance, and I'm not even looking at the DTD, it's unusual to have in XML something like: <a> <b> <a> <b>. So servlet then servlet-mapping, and back to servlet and servlet-mapping makes me suspicious. It should probably be <a> <a> <b> <b>
You've also got a special character in your post.. make sure you don't have a 'hidden' special character in your web.xml file (that won't show on a text editor, but would show up in say, Microsoft Word).
Joined: Feb 10, 2003
basically all i want to know is what I have to add to the server.xml so I can use my own path to my classes. and also want to know what is the minimum I need to put in the web.xml for tomcat 4.1.18. What is the structure for these web.xml. I dont be able to find any great examples of what should be included and what is the minimum to get away with. The web.xml works fine with tomcat 3.2.1 but I havent modified it for tomcat 4.1.18. Therefore how do you modify tomcat 3.2.1 web.xml to change to tomcat 4.1.18?? Is adding the context for server.xml, in the way ive previously noted, correct for tomcat 4.1.18???