RE: How to add a servlet to a new Webapp
To get rid of the invoker, this could be your entire web.xml file: *** ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping /web-app *** -Original Message- From: Rasputin [mailto:[EMAIL PROTECTED]]On Behalf Of Rasputin Sent: Thursday, November 28, 2002 5:24 PM To: Tomcat Users List Subject: Re: How to add a servlet to a new Webapp * Curley, Thomas [EMAIL PROTECTED] [1114 14:14]: If anyone can explain the web.xml file in plain lang / what filters do and how to get rid of the invoker then please do See the link to chapter 5 at http://www..moreservlets.com -- Rasputin :: Jack of All Trades - Master of Nuns -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: How to add a servlet to a new Webapp
Hello David Brown, I am getting the very same 404 server error msg. when I try to run/execute a VERY BASIC JSP, for the current date and time!!! I need some special guidance from u re. how to edit the web.xml file to set the context variable!! And, would you also tell me how to write the and the settings in the server.xml file?! ** On Thu 11/28, David Brown wrote:From: David Brown [mailto: [EMAIL PROTECTED]]To: [EMAIL PROTECTED]: Thu, 28 Nov 2002 12:49:01 -0500Subject: Re: How to add a servlet to a new WebappCurley, Thomas writes: Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1.created webapps/study 2.created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.java and compiled [ok] 3.added the following line to server.xml after the examples 4.just copied the examples web.xml to study/WEB-INF and added the following lines TestServlet com.wrox.projsp.ch03.TestServlet TestServlet /TestServlet 5.restart tomcat RESULT - The requested resource (/study/servlet/TestServlet) is not available. Can anyone see what I am missing ? thanks Thomas -- To unsubscribe, e-mail: For additional commands, e-mail: Hello Thomas, i see this all the time on this ml. i don't know what folks' fascination is w/ server.xml and a basic application. yes, this is working 4 u because web.xml is already defined for the webapp /examples. look closer at how the tc folks do it, namely, using the ant build and allowing tc to do its job by creating a .war/.jar combo and letting the tc server (when bounced, autoreload or using the webapp /manager) expand the .war into its very own: $CATALINA_HOME/webapps//WEB-INF/web.xml and $CATALINA_HOME/webapps//classes//So meServletUbuild.class. pls allow me recommend u look into ant and build.xml. it's worth the trouble if u r serious about tc learning and dev. trying to build anything structured by hand is not recommended. even seasoned vets don't do this because they r the ones that invented this stuff. using ide's r ok (especially when employers require ide use) but i use 3 or 4 tc tools to develop anything i want w/ ease because the chore of structured compilation and deployment is pretty much automatic. hope this help, david. -- To unsubscribe, e-mail: For additional commands, e-mail: ___ Join Excite! - http://www.excite.com The most personalized portal on the Web!
Re: How to add a servlet to a new Webapp
This shouldn't be too hard to solve. Post the associated servlet and servlet-mapping from your web.xml -the one under webapps/study. On Friday, November 29, 2002, at 05:53 PM, Steve R. Burrus wrote: Hello David Brown, I am getting the very same 404 server error msg. when I try to run/execute a VERY BASIC JSP, for the current date and time!!! I need some special guidance from u re. how to edit the web.xml file to set the context variable!! And, would you also tell me how to write the and the settings in the server.xml file?! ** On Thu 11/28, David Brown wrote:From: David Brown [mailto: [EMAIL PROTECTED]]To: [EMAIL PROTECTED]: Thu, 28 Nov 2002 12:49:01 -0500Subject: Re: How to add a servlet to a new WebappCurley, Thomas writes: Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1. created webapps/study 2. created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.java and compiled [ok] 3. added the following line to server.xml after the examples 4. just copied the examples web.xml to study/WEB-INF and added the following lines TestServlet com.wrox.projsp.ch03.TestServlet TestServlet /TestServlet 5. restart tomcat RESULT - The requested resource (/study/servlet/TestServlet) is not available. Can anyone see what I am missing ? thanks Thomas -- To unsubscribe, e-mail: For additional commands, e-mail: Hello Thomas, i see this all the time on this ml. i don't know what folks' fascination is w/ server.xml and a basic application. yes, this is working 4 u because web.xml is already defined for the webapp /examples. look closer at how the tc folks do it, namely, using the ant build and allowing tc to do its job by creating a .war/.jar combo and letting the tc server (when bounced, autoreload or using the webapp /manager) expand the .war into its very own: $CATALINA_HOME/webapps//WEB-INF/web.xml and $CATALINA_HOME/webapps//classes//So meServletUbuild.class. pls allow me recommend u look into ant and build.xml. it's worth the trouble if u r serious about tc learning and dev. trying to build anything structured by hand is not recommended. even seasoned vets don't do this because they r the ones that invented this stuff. using ide's r ok (especially when employers require ide use) but i use 3 or 4 tc tools to develop anything i want w/ ease because the chore of structured compilation and deployment is pretty much automatic. hope this help, david. -- To unsubscribe, e-mail: For additional commands, e-mail: ___ Join Excite! - http://www.excite.com The most personalized portal on the Web! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
How to add a servlet to a new Webapp
Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1. created webapps/study 2. created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.java and compiled [ok] 3. added the following line to server.xml after the examples /Context Context path=/study docBase=study debug=0 /Context 4. just copied the examples web.xml to study/WEB-INF and added the following lines servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping 5. restart tomcat RESULT - The requested resource (/study/servlet/TestServlet) is not available. Can anyone see what I am missing ? thanks Thomas -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to add a servlet to a new Webapp
I believe that servlet has been disabled by default in 4.1.12 for security reasons. That is probably why you can't use: http://localhost:8080/study/servlet/TestServlet Jim -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 12:58 To: [EMAIL PROTECTED] Subject: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1.created webapps/study 2.created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav a and compiled [ok] 3.added the following line to server.xml after the examples /Context Context path=/study docBase=study debug=0 /Context 4.just copied the examples web.xml to study/WEB-INF and added the following lines servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping 5.restart tomcat RESULT - The requested resource (/study/servlet/TestServlet) is not available. Can anyone see what I am missing ? thanks Thomas -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] PLEASE READ: The information contained in this email is confidential and intended for the named recipient(s) only. If you are not an intended recipient of this email you must not copy, distribute or take any further action in reliance on it and you should delete it and notify the sender immediately. Email is not a secure method of communication and Nomura International plc cannot accept responsibility for the accuracy or completeness of this message or any attachment(s). Please examine this email for virus infection, for which Nomura International plc accepts no responsibility. If verification of this email is sought then please request a hard copy. Unless otherwise stated any views or opinions presented are solely those of the author and do not represent those of Nomura International plc. This email is intended for informational purposes only and is not a solicitation or offer to buy or sell securities or related financial instruments. Nomura International plc is regulated by the Financial Services Authority and is a member of the London Stock Exchange. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to add a servlet to a new Webapp
Well I also tried http://localhost:8080/study/servlet/com.wrox.projsp.ch03.TestServlet but the same whereas http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.TestServlet works ?? Thomas -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:04 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp I believe that servlet has been disabled by default in 4.1.12 for security reasons. That is probably why you can't use: http://localhost:8080/study/servlet/TestServlet Jim -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 12:58 To: [EMAIL PROTECTED] Subject: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1.created webapps/study 2.created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav a and compiled [ok] 3.added the following line to server.xml after the examples /Context Context path=/study docBase=study debug=0 /Context 4.just copied the examples web.xml to study/WEB-INF and added the following lines servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping 5.restart tomcat RESULT - The requested resource (/study/servlet/TestServlet) is not available. Can anyone see what I am missing ? thanks Thomas -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] PLEASE READ: The information contained in this email is confidential and intended for the named recipient(s) only. If you are not an intended recipient of this email you must not copy, distribute or take any further action in reliance on it and you should delete it and notify the sender immediately. Email is not a secure method of communication and Nomura International plc cannot accept responsibility for the accuracy or completeness of this message or any attachment(s). Please examine this email for virus infection, for which Nomura International plc accepts no responsibility. If verification of this email is sought then please request a hard copy. Unless otherwise stated any views or opinions presented are solely those of the author and do not represent those of Nomura International plc. This email is intended for informational purposes only and is not a solicitation or offer to buy or sell securities or related financial instruments. Nomura International plc is regulated by the Financial Services Authority and is a member of the London Stock Exchange. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
AW: How to add a servlet to a new Webapp
Hi! Try to access /study/TestServlet!! Martin -Ursprüngliche Nachricht- Von: Curley, Thomas [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 28. November 2002 13:58 An: [EMAIL PROTECTED] Betreff: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1.created webapps/study 2.created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav a and compiled [ok] 3.added the following line to server.xml after the examples /Context Context path=/study docBase=study debug=0 /Context 4.just copied the examples web.xml to study/WEB-INF and added the following lines servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping 5.restart tomcat RESULT - The requested resource (/study/servlet/TestServlet) is not available. Can anyone see what I am missing ? thanks Thomas -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] attachment: winmail.dat-- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to add a servlet to a new Webapp
No - The requested resource (/study/TestServlet) is not available. Note I have just added the servlet mappings into examples web.xml and I can also now access the TestServlet in the examples context using either http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.TestServlet or http://localhost:8080/examples/servlet/TestServlet but neither works for the study webapp ? -Original Message- From: Martin Gruner [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:10 To: 'Tomcat Users List' Subject: AW: How to add a servlet to a new Webapp Hi! Try to access /study/TestServlet!! Martin -Ursprüngliche Nachricht- Von: Curley, Thomas [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 28. November 2002 13:58 An: [EMAIL PROTECTED] Betreff: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1.created webapps/study 2.created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav a and compiled [ok] 3.added the following line to server.xml after the examples /Context Context path=/study docBase=study debug=0 /Context 4.just copied the examples web.xml to study/WEB-INF and added the following lines servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping 5.restart tomcat RESULT - The requested resource (/study/servlet/TestServlet) is not available. Can anyone see what I am missing ? thanks Thomas -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to add a servlet to a new Webapp
Can you post your web.xml? -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:16 To: Tomcat Users List; [EMAIL PROTECTED] Subject: RE: How to add a servlet to a new Webapp No - The requested resource (/study/TestServlet) is not available. Note I have just added the servlet mappings into examples web.xml and I can also now access the TestServlet in the examples context using either http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.Te stServlet or http://localhost:8080/examples/servlet/TestServlet but neither works for the study webapp ? -Original Message- From: Martin Gruner [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:10 To: 'Tomcat Users List' Subject: AW: How to add a servlet to a new Webapp Hi! Try to access /study/TestServlet!! Martin -Ursprüngliche Nachricht- Von: Curley, Thomas [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 28. November 2002 13:58 An: [EMAIL PROTECTED] Betreff: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1. created webapps/study 2. created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav a and compiled [ok] 3. added the following line to server.xml after the examples /Context Context path=/study docBase=study debug=0 /Context 4. just copied the examples web.xml to study/WEB-INF and added the following lines servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping 5. restart tomcat RESULT - The requested resource (/study/servlet/TestServlet) is not available. Can anyone see what I am missing ? thanks Thomas -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] PLEASE READ: The information contained in this email is confidential and intended for the named recipient(s) only. If you are not an intended recipient of this email you must not copy, distribute or take any further action in reliance on it and you should delete it and notify the sender immediately. Email is not a secure method of communication and Nomura International plc cannot accept responsibility for the accuracy or completeness of this message or any attachment(s). Please examine this email for virus infection, for which Nomura International plc accepts no responsibility. If verification of this email is sought then please request a hard copy. Unless otherwise stated any views or opinions presented are solely those of the author and do not represent those of Nomura International plc. This email is intended for informational purposes only and is not a solicitation or offer to buy or sell securities or related financial instruments. Nomura International plc is regulated by the Financial Services Authority and is a member of the London Stock Exchange. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to add a servlet to a new Webapp
Jim, I just took the examples web.xml and added the mapping - here it is -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:18 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp Can you post your web.xml? -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:16 To: Tomcat Users List; [EMAIL PROTECTED] Subject: RE: How to add a servlet to a new Webapp No - The requested resource (/study/TestServlet) is not available. Note I have just added the servlet mappings into examples web.xml and I can also now access the TestServlet in the examples context using either http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.Te stServlet or http://localhost:8080/examples/servlet/TestServlet but neither works for the study webapp ? -Original Message- From: Martin Gruner [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:10 To: 'Tomcat Users List' Subject: AW: How to add a servlet to a new Webapp Hi! Try to access /study/TestServlet!! Martin -Ursprüngliche Nachricht- Von: Curley, Thomas [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 28. November 2002 13:58 An: [EMAIL PROTECTED] Betreff: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1. created webapps/study 2. created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav a and compiled [ok] 3. added the following line to server.xml after the examples /Context Context path=/study docBase=study debug=0 /Context 4. just copied the examples web.xml to study/WEB-INF and added the following lines servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping 5. restart tomcat RESULT - The requested resource (/study/servlet/TestServlet) is not available. Can anyone see what I am missing ? thanks Thomas -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] PLEASE READ: The information contained in this email is confidential and intended for the named recipient(s) only. If you are not an intended recipient of this email you must not copy, distribute or take any further action in reliance on it and you should delete it and notify the sender immediately. Email is not a secure method of communication and Nomura International plc cannot accept responsibility for the accuracy or completeness of this message or any attachment(s). Please examine this email for virus infection, for which Nomura International plc accepts no responsibility. If verification of this email is sought then please request a hard copy. Unless otherwise stated any views or opinions presented are solely those of the author and do not represent those of Nomura International plc. This email is intended for informational purposes only and is not a solicitation or offer to buy or sell securities or related financial instruments. Nomura International plc is regulated by the Financial Services Authority and is a member of the London Stock Exchange. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameTomcat Examples/display-name description Study servlets and JSP pages. /description !-- Define servlet-mapped and path-mapped example filters -- filter filter-nameServlet Mapped Filter/filter-name filter-classfilters.ExampleFilter/filter-class init-param param-nameattribute/param-name param-valuefilters.ExampleFilter.SERVLET_MAPPED/param-value /init-param /filter filter filter-namePath Mapped Filter/filter-name filter-classfilters.ExampleFilter/filter-class init-param param-nameattribute/param-name param-valuefilters.ExampleFilter.PATH_MAPPED/param-value /init-param /filter filter filter-nameRequest Dumper Filter/filter-name
RE: How to add a servlet to a new Webapp
If I understand everything correctly :) the invoker servlet is by default disabled. I had to add the following to my web.xml to be able to access servlets that are not defined in the web.xml: servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping then it worked for me :) Ron On Thu, 2002-11-28 at 14:16, Curley, Thomas wrote: No - The requested resource (/study/TestServlet) is not available. Note I have just added the servlet mappings into examples web.xml and I can also now access the TestServlet in the examples context using either http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.TestServlet or http://localhost:8080/examples/servlet/TestServlet but neither works for the study webapp ? -Original Message- From: Martin Gruner [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:10 To: 'Tomcat Users List' Subject: AW: How to add a servlet to a new Webapp Hi! Try to access /study/TestServlet!! Martin -Ursprüngliche Nachricht- Von: Curley, Thomas [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 28. November 2002 13:58 An: [EMAIL PROTECTED] Betreff: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1. created webapps/study 2. created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav a and compiled [ok] 3. added the following line to server.xml after the examples /Context Context path=/study docBase=study debug=0 /Context 4. just copied the examples web.xml to study/WEB-INF and added the following lines servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping 5. restart tomcat RESULT - The requested resource (/study/servlet/TestServlet) is not available. Can anyone see what I am missing ? thanks Thomas -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to add a servlet to a new Webapp
This problem is new with 4.1.12. For security reasons the invoker servlet had been disabled in the global /conf/web.xml file. This invoker servlet usually loads user servlets that are not mapped correctly as far as i understand. This is done by using a default mapping /servlet/*. In productive systems this should not be done, instead correct mapping is required. In the /examples webapp the invoker servlet had been enabled again with the local web.xml. That's why it's working in examples and not in study. Because in your study web.xml you won't have it enabled manually and thus the default from /conf/web.xml ist used where this feature is disabled. Thus the mapping /servlet/... to servlets is just Tomcat specifically done via the invoker servlet which is now (4.1.12+) disabled by default. But actually you should not need /servlet/ at all, if your mapping is correct. Try http://localhost:8080/study/com.wrox.projsp.ch03.Testservlet or make a shorter mapping to /study/Testservlet in your web.xml mech -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: Donnerstag, 28. November 2002 14:06 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Well I also tried http://localhost:8080/study/servlet/com.wrox.projsp.ch03.TestServlet but the same whereas http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.Te stServlet works ?? Thomas -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:04 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp I believe that servlet has been disabled by default in 4.1.12 for security reasons. That is probably why you can't use: http://localhost:8080/study/servlet/TestServlet Jim -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 12:58 To: [EMAIL PROTECTED] Subject: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1. created webapps/study 2. created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav a and compiled [ok] 3. added the following line to server.xml after the examples /Context Context path=/study docBase=study debug=0 /Context 4. just copied the examples web.xml to study/WEB-INF and added the following lines servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping 5. restart tomcat RESULT - The requested resource (/study/servlet/TestServlet) is not available. Can anyone see what I am missing ? thanks Thomas -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] PLEASE READ: The information contained in this email is confidential and intended for the named recipient(s) only. If you are not an intended recipient of this email you must not copy, distribute or take any further action in reliance on it and you should delete it and notify the sender immediately. Email is not a secure method of communication and Nomura International plc cannot accept responsibility for the accuracy or completeness of this message or any attachment(s). Please examine this email for virus infection, for which Nomura International plc accepts no responsibility. If verification of this email is sought then please request a hard copy. Unless otherwise stated any views or opinions presented are solely those of the author and do not represent those of Nomura International plc. This email is intended for informational purposes only and is not a solicitation or offer to buy or sell securities or related financial instruments. Nomura International plc is regulated by the Financial Services Authority and is a member of the London Stock Exchange. -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to add a servlet to a new Webapp
Thomas has got a mapping to the invoker servlet in the web.xml file he posted so it should not be a problem. -Original Message- From: mech [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:25 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp This problem is new with 4.1.12. For security reasons the invoker servlet had been disabled in the global /conf/web.xml file. This invoker servlet usually loads user servlets that are not mapped correctly as far as i understand. This is done by using a default mapping /servlet/*. In productive systems this should not be done, instead correct mapping is required. In the /examples webapp the invoker servlet had been enabled again with the local web.xml. That's why it's working in examples and not in study. Because in your study web.xml you won't have it enabled manually and thus the default from /conf/web.xml ist used where this feature is disabled. Thus the mapping /servlet/... to servlets is just Tomcat specifically done via the invoker servlet which is now (4.1.12+) disabled by default. But actually you should not need /servlet/ at all, if your mapping is correct. Try http://localhost:8080/study/com.wrox.projsp.ch03.Testservlet or make a shorter mapping to /study/Testservlet in your web.xml mech -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: Donnerstag, 28. November 2002 14:06 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Well I also tried http://localhost:8080/study/servlet/com.wrox.projsp.ch03.TestServlet but the same whereas http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.Te stServlet works ?? Thomas -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:04 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp I believe that servlet has been disabled by default in 4.1.12 for security reasons. That is probably why you can't use: http://localhost:8080/study/servlet/TestServlet Jim -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 12:58 To: [EMAIL PROTECTED] Subject: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1.created webapps/study 2.created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav a and compiled [ok] 3.added the following line to server.xml after the examples /Context Context path=/study docBase=study debug=0 /Context 4.just copied the examples web.xml to study/WEB-INF and added the following lines servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping 5.restart tomcat RESULT - The requested resource (/study/servlet/TestServlet) is not available. Can anyone see what I am missing ? thanks Thomas -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] PLEASE READ: The information contained in this email is confidential and intended for the named recipient(s) only. If you are not an intended recipient of this email you must not copy, distribute or take any further action in reliance on it and you should delete it and notify the sender immediately. Email is not a secure method of communication and Nomura International plc cannot accept responsibility for the accuracy or completeness of this message or any attachment(s). Please examine this email for virus infection, for which Nomura International plc accepts no responsibility. If verification of this email is sought then please request a hard copy. Unless otherwise stated any views or opinions presented are solely those of the author and do not represent those of Nomura International plc. This email is intended for informational purposes only and is not a solicitation or offer to buy or sell securities or related financial instruments. Nomura International plc is regulated by the Financial Services Authority and is a member of the London Stock Exchange. -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands,
RE: How to add a servlet to a new Webapp
Correct ! - I origionally copied the examples web.xml -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:28 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp Thomas has got a mapping to the invoker servlet in the web.xml file he posted so it should not be a problem. -Original Message- From: mech [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:25 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp This problem is new with 4.1.12. For security reasons the invoker servlet had been disabled in the global /conf/web.xml file. This invoker servlet usually loads user servlets that are not mapped correctly as far as i understand. This is done by using a default mapping /servlet/*. In productive systems this should not be done, instead correct mapping is required. In the /examples webapp the invoker servlet had been enabled again with the local web.xml. That's why it's working in examples and not in study. Because in your study web.xml you won't have it enabled manually and thus the default from /conf/web.xml ist used where this feature is disabled. Thus the mapping /servlet/... to servlets is just Tomcat specifically done via the invoker servlet which is now (4.1.12+) disabled by default. But actually you should not need /servlet/ at all, if your mapping is correct. Try http://localhost:8080/study/com.wrox.projsp.ch03.Testservlet or make a shorter mapping to /study/Testservlet in your web.xml mech -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: Donnerstag, 28. November 2002 14:06 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Well I also tried http://localhost:8080/study/servlet/com.wrox.projsp.ch03.TestServlet but the same whereas http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.Te stServlet works ?? Thomas -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:04 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp I believe that servlet has been disabled by default in 4.1.12 for security reasons. That is probably why you can't use: http://localhost:8080/study/servlet/TestServlet Jim -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 12:58 To: [EMAIL PROTECTED] Subject: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1.created webapps/study 2.created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav a and compiled [ok] 3.added the following line to server.xml after the examples /Context Context path=/study docBase=study debug=0 /Context 4.just copied the examples web.xml to study/WEB-INF and added the following lines servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping 5.restart tomcat RESULT - The requested resource (/study/servlet/TestServlet) is not available. Can anyone see what I am missing ? thanks Thomas -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] PLEASE READ: The information contained in this email is confidential and intended for the named recipient(s) only. If you are not an intended recipient of this email you must not copy, distribute or take any further action in reliance on it and you should delete it and notify the sender immediately. Email is not a secure method of communication and Nomura International plc cannot accept responsibility for the accuracy or completeness of this message or any attachment(s). Please examine this email for virus infection, for which Nomura International plc accepts no responsibility. If verification of this email is sought then please request a hard copy. Unless otherwise stated any views or opinions presented are solely those of the author and do not represent those of Nomura International plc. This email is intended for informational purposes only and is not a solicitation or offer to buy or sell securities or related financial instruments. Nomura
RE: How to add a servlet to a new Webapp
You mention in your first post that the servlet works if you create the package structure in WEB-INF/classes. Is the servlet no longer in this directory? -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:29 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Correct ! - I origionally copied the examples web.xml -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:28 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp Thomas has got a mapping to the invoker servlet in the web.xml file he posted so it should not be a problem. -Original Message- From: mech [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:25 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp This problem is new with 4.1.12. For security reasons the invoker servlet had been disabled in the global /conf/web.xml file. This invoker servlet usually loads user servlets that are not mapped correctly as far as i understand. This is done by using a default mapping /servlet/*. In productive systems this should not be done, instead correct mapping is required. In the /examples webapp the invoker servlet had been enabled again with the local web.xml. That's why it's working in examples and not in study. Because in your study web.xml you won't have it enabled manually and thus the default from /conf/web.xml ist used where this feature is disabled. Thus the mapping /servlet/... to servlets is just Tomcat specifically done via the invoker servlet which is now (4.1.12+) disabled by default. But actually you should not need /servlet/ at all, if your mapping is correct. Try http://localhost:8080/study/com.wrox.projsp.ch03.Testservlet or make a shorter mapping to /study/Testservlet in your web.xml mech -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: Donnerstag, 28. November 2002 14:06 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Well I also tried http://localhost:8080/study/servlet/com.wrox.projsp.ch03.TestServlet but the same whereas http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.Te stServlet works ?? Thomas -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:04 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp I believe that servlet has been disabled by default in 4.1.12 for security reasons. That is probably why you can't use: http://localhost:8080/study/servlet/TestServlet Jim -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 12:58 To: [EMAIL PROTECTED] Subject: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1. created webapps/study 2. created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav a and compiled [ok] 3. added the following line to server.xml after the examples /Context Context path=/study docBase=study debug=0 /Context 4. just copied the examples web.xml to study/WEB-INF and added the following lines servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping 5. restart tomcat RESULT - The requested resource (/study/servlet/TestServlet) is not available. Can anyone see what I am missing ? thanks Thomas -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] PLEASE READ: The information contained in this email is confidential and intended for the named recipient(s) only. If you are not an intended recipient of this email you must not copy, distribute or take any further action in reliance on it and you should delete it and notify the sender immediately. Email is not a secure method of communication and Nomura International plc cannot accept responsibility for the accuracy or completeness of this message or any attachment(s).
RE: How to add a servlet to a new Webapp
Jim - its in both webapps under classes - com.wrox.projsp.ch03.TestServlet -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:35 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp You mention in your first post that the servlet works if you create the package structure in WEB-INF/classes. Is the servlet no longer in this directory? -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:29 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Correct ! - I origionally copied the examples web.xml -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:28 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp Thomas has got a mapping to the invoker servlet in the web.xml file he posted so it should not be a problem. -Original Message- From: mech [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:25 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp This problem is new with 4.1.12. For security reasons the invoker servlet had been disabled in the global /conf/web.xml file. This invoker servlet usually loads user servlets that are not mapped correctly as far as i understand. This is done by using a default mapping /servlet/*. In productive systems this should not be done, instead correct mapping is required. In the /examples webapp the invoker servlet had been enabled again with the local web.xml. That's why it's working in examples and not in study. Because in your study web.xml you won't have it enabled manually and thus the default from /conf/web.xml ist used where this feature is disabled. Thus the mapping /servlet/... to servlets is just Tomcat specifically done via the invoker servlet which is now (4.1.12+) disabled by default. But actually you should not need /servlet/ at all, if your mapping is correct. Try http://localhost:8080/study/com.wrox.projsp.ch03.Testservlet or make a shorter mapping to /study/Testservlet in your web.xml mech -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: Donnerstag, 28. November 2002 14:06 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Well I also tried http://localhost:8080/study/servlet/com.wrox.projsp.ch03.TestServlet but the same whereas http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.Te stServlet works ?? Thomas -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:04 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp I believe that servlet has been disabled by default in 4.1.12 for security reasons. That is probably why you can't use: http://localhost:8080/study/servlet/TestServlet Jim -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 12:58 To: [EMAIL PROTECTED] Subject: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1. created webapps/study 2. created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav a and compiled [ok] 3. added the following line to server.xml after the examples /Context Context path=/study docBase=study debug=0 /Context 4. just copied the examples web.xml to study/WEB-INF and added the following lines servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping 5. restart tomcat RESULT - The requested resource (/study/servlet/TestServlet) is not available. Can anyone see what I am missing ? thanks Thomas -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] PLEASE READ: The information contained in this email is confidential and intended for the named recipient(s) only. If you are not an intended recipient of this email you must not copy, distribute or take any further action in reliance on it
RE: How to add a servlet to a new Webapp
Here the study.jar file - cd to webapps and jar -xvf . -Original Message- From: Curley, Thomas Sent: 28 November 2002 13:37 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Jim - its in both webapps under classes - com.wrox.projsp.ch03.TestServlet -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:35 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp You mention in your first post that the servlet works if you create the package structure in WEB-INF/classes. Is the servlet no longer in this directory? -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:29 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Correct ! - I origionally copied the examples web.xml -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:28 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp Thomas has got a mapping to the invoker servlet in the web.xml file he posted so it should not be a problem. -Original Message- From: mech [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:25 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp This problem is new with 4.1.12. For security reasons the invoker servlet had been disabled in the global /conf/web.xml file. This invoker servlet usually loads user servlets that are not mapped correctly as far as i understand. This is done by using a default mapping /servlet/*. In productive systems this should not be done, instead correct mapping is required. In the /examples webapp the invoker servlet had been enabled again with the local web.xml. That's why it's working in examples and not in study. Because in your study web.xml you won't have it enabled manually and thus the default from /conf/web.xml ist used where this feature is disabled. Thus the mapping /servlet/... to servlets is just Tomcat specifically done via the invoker servlet which is now (4.1.12+) disabled by default. But actually you should not need /servlet/ at all, if your mapping is correct. Try http://localhost:8080/study/com.wrox.projsp.ch03.Testservlet or make a shorter mapping to /study/Testservlet in your web.xml mech -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: Donnerstag, 28. November 2002 14:06 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Well I also tried http://localhost:8080/study/servlet/com.wrox.projsp.ch03.TestServlet but the same whereas http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.Te stServlet works ?? Thomas -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:04 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp I believe that servlet has been disabled by default in 4.1.12 for security reasons. That is probably why you can't use: http://localhost:8080/study/servlet/TestServlet Jim -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 12:58 To: [EMAIL PROTECTED] Subject: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1. created webapps/study 2. created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav a and compiled [ok] 3. added the following line to server.xml after the examples /Context Context path=/study docBase=study debug=0 /Context 4. just copied the examples web.xml to study/WEB-INF and added the following lines servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping 5. restart tomcat RESULT - The requested resource (/study/servlet/TestServlet) is not available. Can anyone see what I am missing ? thanks Thomas -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] PLEASE READ: The information contained in this
Re: How to add a servlet to a new Webapp
If you copied the examples web.xml, then you must have a lot of references to servlet classes and filters not present in your new webapp. This can make the context not to be created, because of exceptions raised during context initialization. Try to delete all unused entries before starting the server :-) Hope it helps - Original Message - From: Curley, Thomas [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, November 28, 2002 2:37 PM Subject: RE: How to add a servlet to a new Webapp Jim - its in both webapps under classes - com.wrox.projsp.ch03.TestServlet -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:35 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp You mention in your first post that the servlet works if you create the package structure in WEB-INF/classes. Is the servlet no longer in this directory? -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:29 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Correct ! - I origionally copied the examples web.xml -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:28 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp Thomas has got a mapping to the invoker servlet in the web.xml file he posted so it should not be a problem. -Original Message- From: mech [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:25 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp This problem is new with 4.1.12. For security reasons the invoker servlet had been disabled in the global /conf/web.xml file. This invoker servlet usually loads user servlets that are not mapped correctly as far as i understand. This is done by using a default mapping /servlet/*. In productive systems this should not be done, instead correct mapping is required. In the /examples webapp the invoker servlet had been enabled again with the local web.xml. That's why it's working in examples and not in study. Because in your study web.xml you won't have it enabled manually and thus the default from /conf/web.xml ist used where this feature is disabled. Thus the mapping /servlet/... to servlets is just Tomcat specifically done via the invoker servlet which is now (4.1.12+) disabled by default. But actually you should not need /servlet/ at all, if your mapping is correct. Try http://localhost:8080/study/com.wrox.projsp.ch03.Testservlet or make a shorter mapping to /study/Testservlet in your web.xml mech -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: Donnerstag, 28. November 2002 14:06 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Well I also tried http://localhost:8080/study/servlet/com.wrox.projsp.ch03.TestServlet but the same whereas http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.Te stServlet works ?? Thomas -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:04 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp I believe that servlet has been disabled by default in 4.1.12 for security reasons. That is probably why you can't use: http://localhost:8080/study/servlet/TestServlet Jim -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 12:58 To: [EMAIL PROTECTED] Subject: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1. created webapps/study 2. created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav a and compiled [ok] 3. added the following line to server.xml after the examples /Context Context path=/study docBase=study debug=0 /Context 4. just copied the examples web.xml to study/WEB-INF and added the following lines servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping 5. restart tomcat RESULT - The requested resource
RE: How to add a servlet to a new Webapp
thanks - will try -Original Message- From: Rodrigo Ruiz [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:46 To: Tomcat Users List Subject: Re: How to add a servlet to a new Webapp If you copied the examples web.xml, then you must have a lot of references to servlet classes and filters not present in your new webapp. This can make the context not to be created, because of exceptions raised during context initialization. Try to delete all unused entries before starting the server :-) Hope it helps - Original Message - From: Curley, Thomas [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, November 28, 2002 2:37 PM Subject: RE: How to add a servlet to a new Webapp Jim - its in both webapps under classes - com.wrox.projsp.ch03.TestServlet -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:35 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp You mention in your first post that the servlet works if you create the package structure in WEB-INF/classes. Is the servlet no longer in this directory? -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:29 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Correct ! - I origionally copied the examples web.xml -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:28 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp Thomas has got a mapping to the invoker servlet in the web.xml file he posted so it should not be a problem. -Original Message- From: mech [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:25 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp This problem is new with 4.1.12. For security reasons the invoker servlet had been disabled in the global /conf/web.xml file. This invoker servlet usually loads user servlets that are not mapped correctly as far as i understand. This is done by using a default mapping /servlet/*. In productive systems this should not be done, instead correct mapping is required. In the /examples webapp the invoker servlet had been enabled again with the local web.xml. That's why it's working in examples and not in study. Because in your study web.xml you won't have it enabled manually and thus the default from /conf/web.xml ist used where this feature is disabled. Thus the mapping /servlet/... to servlets is just Tomcat specifically done via the invoker servlet which is now (4.1.12+) disabled by default. But actually you should not need /servlet/ at all, if your mapping is correct. Try http://localhost:8080/study/com.wrox.projsp.ch03.Testservlet or make a shorter mapping to /study/Testservlet in your web.xml mech -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: Donnerstag, 28. November 2002 14:06 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Well I also tried http://localhost:8080/study/servlet/com.wrox.projsp.ch03.TestServlet but the same whereas http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.Te stServlet works ?? Thomas -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:04 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp I believe that servlet has been disabled by default in 4.1.12 for security reasons. That is probably why you can't use: http://localhost:8080/study/servlet/TestServlet Jim -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 12:58 To: [EMAIL PROTECTED] Subject: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1. created webapps/study 2. created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav a and compiled [ok] 3. added the following line to server.xml after the examples /Context Context path=/study docBase=study debug=0 /Context 4. just copied the examples web.xml to study/WEB-INF and added the following lines servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping
RE: How to add a servlet to a new Webapp
Hi Thomas, I got it to work using this web.xml: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameTomcat Examples/display-name description Study servlets and JSP pages. /description servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping /web-app and this URL: http://localhost:8080/study/TestServlet Regards Jim. -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:41 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Here the study.jar file - cd to webapps and jar -xvf . -Original Message- From: Curley, Thomas Sent: 28 November 2002 13:37 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Jim - its in both webapps under classes - com.wrox.projsp.ch03.TestServlet -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:35 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp You mention in your first post that the servlet works if you create the package structure in WEB-INF/classes. Is the servlet no longer in this directory? -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:29 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Correct ! - I origionally copied the examples web.xml -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:28 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp Thomas has got a mapping to the invoker servlet in the web.xml file he posted so it should not be a problem. -Original Message- From: mech [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:25 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp This problem is new with 4.1.12. For security reasons the invoker servlet had been disabled in the global /conf/web.xml file. This invoker servlet usually loads user servlets that are not mapped correctly as far as i understand. This is done by using a default mapping /servlet/*. In productive systems this should not be done, instead correct mapping is required. In the /examples webapp the invoker servlet had been enabled again with the local web.xml. That's why it's working in examples and not in study. Because in your study web.xml you won't have it enabled manually and thus the default from /conf/web.xml ist used where this feature is disabled. Thus the mapping /servlet/... to servlets is just Tomcat specifically done via the invoker servlet which is now (4.1.12+) disabled by default. But actually you should not need /servlet/ at all, if your mapping is correct. Try http://localhost:8080/study/com.wrox.projsp.ch03.Testservlet or make a shorter mapping to /study/Testservlet in your web.xml mech -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: Donnerstag, 28. November 2002 14:06 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Well I also tried http://localhost:8080/study/servlet/com.wrox.projsp.ch03.TestServlet but the same whereas http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.Te stServlet works ?? Thomas -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:04 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp I believe that servlet has been disabled by default in 4.1.12 for security reasons. That is probably why you can't use: http://localhost:8080/study/servlet/TestServlet Jim -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 12:58 To: [EMAIL PROTECTED] Subject: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1.created webapps/study 2.created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav a and compiled [ok] 3.added
RE: How to add a servlet to a new Webapp
Hi, this is now working thanks to you all. Attached is the web.xml. As Rodrigo stated I pruned it down and it turns out that at a min I need the 'Servlet Mapped Filter', the invoker mapping. If anyone can explain the web.xml file in plain lang / what filters do and how to get rid of the invoker then please do Thomas -Original Message- From: Curley, Thomas Sent: 28 November 2002 13:48 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp thanks - will try -Original Message- From: Ruiz [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:46 To: Tomcat Users List Subject: Re: How to add a servlet to a new Webapp If you copied the examples web.xml, then you must have a lot of references to servlet classes and filters not present in your new webapp. This can make the context not to be created, because of exceptions raised during context initialization. Try to delete all unused entries before starting the server :-) Hope it helps - Original Message - From: Curley, Thomas [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, November 28, 2002 2:37 PM Subject: RE: How to add a servlet to a new Webapp Jim - its in both webapps under classes - com.wrox.projsp.ch03.TestServlet -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:35 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp You mention in your first post that the servlet works if you create the package structure in WEB-INF/classes. Is the servlet no longer in this directory? -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:29 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Correct ! - I origionally copied the examples web.xml -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:28 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp Thomas has got a mapping to the invoker servlet in the web.xml file he posted so it should not be a problem. -Original Message- From: mech [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:25 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp This problem is new with 4.1.12. For security reasons the invoker servlet had been disabled in the global /conf/web.xml file. This invoker servlet usually loads user servlets that are not mapped correctly as far as i understand. This is done by using a default mapping /servlet/*. In productive systems this should not be done, instead correct mapping is required. In the /examples webapp the invoker servlet had been enabled again with the local web.xml. That's why it's working in examples and not in study. Because in your study web.xml you won't have it enabled manually and thus the default from /conf/web.xml ist used where this feature is disabled. Thus the mapping /servlet/... to servlets is just Tomcat specifically done via the invoker servlet which is now (4.1.12+) disabled by default. But actually you should not need /servlet/ at all, if your mapping is correct. Try http://localhost:8080/study/com.wrox.projsp.ch03.Testservlet or make a shorter mapping to /study/Testservlet in your web.xml mech -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: Donnerstag, 28. November 2002 14:06 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Well I also tried http://localhost:8080/study/servlet/com.wrox.projsp.ch03.TestServlet but the same whereas http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.Te stServlet works ?? Thomas -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:04 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp I believe that servlet has been disabled by default in 4.1.12 for security reasons. That is probably why you can't use: http://localhost:8080/study/servlet/TestServlet Jim -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 12:58 To: [EMAIL PROTECTED] Subject: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1. created webapps/study 2. created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav a and compiled [ok] 3. added the following line to
RE: How to add a servlet to a new Webapp
Jim, many thanks NB: - presume you uncommented the invoker in conf/web.xml to get this working Thomas -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 14:08 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp Hi Thomas, I got it to work using this web.xml: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameTomcat Examples/display-name description Study servlets and JSP pages. /description servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping /web-app and this URL: http://localhost:8080/study/TestServlet Regards Jim. -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:41 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Here the study.jar file - cd to webapps and jar -xvf . -Original Message- From: Curley, Thomas Sent: 28 November 2002 13:37 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Jim - its in both webapps under classes - com.wrox.projsp.ch03.TestServlet -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:35 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp You mention in your first post that the servlet works if you create the package structure in WEB-INF/classes. Is the servlet no longer in this directory? -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:29 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Correct ! - I origionally copied the examples web.xml -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:28 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp Thomas has got a mapping to the invoker servlet in the web.xml file he posted so it should not be a problem. -Original Message- From: mech [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:25 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp This problem is new with 4.1.12. For security reasons the invoker servlet had been disabled in the global /conf/web.xml file. This invoker servlet usually loads user servlets that are not mapped correctly as far as i understand. This is done by using a default mapping /servlet/*. In productive systems this should not be done, instead correct mapping is required. In the /examples webapp the invoker servlet had been enabled again with the local web.xml. That's why it's working in examples and not in study. Because in your study web.xml you won't have it enabled manually and thus the default from /conf/web.xml ist used where this feature is disabled. Thus the mapping /servlet/... to servlets is just Tomcat specifically done via the invoker servlet which is now (4.1.12+) disabled by default. But actually you should not need /servlet/ at all, if your mapping is correct. Try http://localhost:8080/study/com.wrox.projsp.ch03.Testservlet or make a shorter mapping to /study/Testservlet in your web.xml mech -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: Donnerstag, 28. November 2002 14:06 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Well I also tried http://localhost:8080/study/servlet/com.wrox.projsp.ch03.TestServlet but the same whereas http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.Te stServlet works ?? Thomas -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:04 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp I believe that servlet has been disabled by default in 4.1.12 for security reasons. That is probably why you can't use: http://localhost:8080/study/servlet/TestServlet Jim -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 12:58 To: [EMAIL PROTECTED] Subject: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The
RE: How to add a servlet to a new Webapp
You would not need to uncomment the invoker in this case because the servlet mapping is specified in your web.xml file. If you did not have this in the web.xml file: servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping Then you would need to uncomment the invoker and change the URL to this: http://localhost:8080/study/servlet/TestServlet Regards Jim. -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 14:22 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Jim, many thanks NB: - presume you uncommented the invoker in conf/web.xml to get this working Thomas -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 14:08 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp Hi Thomas, I got it to work using this web.xml: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameTomcat Examples/display-name description Study servlets and JSP pages. /description servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping /web-app and this URL: http://localhost:8080/study/TestServlet Regards Jim. -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:41 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Here the study.jar file - cd to webapps and jar -xvf . -Original Message- From: Curley, Thomas Sent: 28 November 2002 13:37 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Jim - its in both webapps under classes - com.wrox.projsp.ch03.TestServlet -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:35 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp You mention in your first post that the servlet works if you create the package structure in WEB-INF/classes. Is the servlet no longer in this directory? -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:29 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Correct ! - I origionally copied the examples web.xml -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:28 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp Thomas has got a mapping to the invoker servlet in the web.xml file he posted so it should not be a problem. -Original Message- From: mech [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:25 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp This problem is new with 4.1.12. For security reasons the invoker servlet had been disabled in the global /conf/web.xml file. This invoker servlet usually loads user servlets that are not mapped correctly as far as i understand. This is done by using a default mapping /servlet/*. In productive systems this should not be done, instead correct mapping is required. In the /examples webapp the invoker servlet had been enabled again with the local web.xml. That's why it's working in examples and not in study. Because in your study web.xml you won't have it enabled manually and thus the default from /conf/web.xml ist used where this feature is disabled. Thus the mapping /servlet/... to servlets is just Tomcat specifically done via the invoker servlet which is now (4.1.12+) disabled by default. But actually you should not need /servlet/ at all, if your mapping is correct. Try http://localhost:8080/study/com.wrox.projsp.ch03.Testservlet or make a shorter mapping to /study/Testservlet in your web.xml mech -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: Donnerstag, 28. November 2002 14:06 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Well I also tried http://localhost:8080/study/servlet/com.wrox.projsp.ch03.TestServlet but the same whereas http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.Te stServlet works ??
Re: How to add a servlet to a new Webapp
Thomas, filters are classes that preprocess / postprocess servlet requests. Defining a filter, you are instructing the server to pass the requests to a specified filter, instead of directly passing it to the servlet. Filter is responsible of redirecting the request to the servlet between pre and postprocess. If you remove from your web.xml all filter, and filter-mapping tags, the webapp should still work properly. As some pointed in previous messages, the invoker servlet was disabled in Tomcat 4.1.12. This was done because of a security hole that allowed a hacker to obtain the source code of your JSPs through direct invocation to this servlet. The invoker servlet is the one used for serving requests of the style /servlet/MyServlet. This means that having the invoker servlet disabled you cannot access your servlet with such a URL. But you have an entry in your web.xml that makes the last point irrelevant: servlet servlet-nameTestServlet/servlet-name servlet-classcom.wrox.projsp.ch03.TestServlet/servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping With these lines you are specifying that you can access your servlet directly with a URL with the form: http://yourserver/study/TestServlet Without the /servlet/ part. URLs with /servlet/ are useful for accesing servlets that don't have an associated mapping, but in your case, as you explicitly mapped it to /TestServlet, you can use this mapping. - Original Message - From: Curley, Thomas [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, November 28, 2002 3:14 PM Subject: RE: How to add a servlet to a new Webapp Hi, this is now working thanks to you all. Attached is the web.xml. As Rodrigo stated I pruned it down and it turns out that at a min I need the 'Servlet Mapped Filter', the invoker mapping. If anyone can explain the web.xml file in plain lang / what filters do and how to get rid of the invoker then please do Thomas -Original Message- From: Curley, Thomas Sent: 28 November 2002 13:48 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp thanks - will try -Original Message- From: Ruiz [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:46 To: Tomcat Users List Subject: Re: How to add a servlet to a new Webapp If you copied the examples web.xml, then you must have a lot of references to servlet classes and filters not present in your new webapp. This can make the context not to be created, because of exceptions raised during context initialization. Try to delete all unused entries before starting the server :-) Hope it helps - Original Message - From: Curley, Thomas [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, November 28, 2002 2:37 PM Subject: RE: How to add a servlet to a new Webapp Jim - its in both webapps under classes - com.wrox.projsp.ch03.TestServlet -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:35 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp You mention in your first post that the servlet works if you create the package structure in WEB-INF/classes. Is the servlet no longer in this directory? -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:29 To: Tomcat Users List Subject: RE: How to add a servlet to a new Webapp Correct ! - I origionally copied the examples web.xml -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:28 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp Thomas has got a mapping to the invoker servlet in the web.xml file he posted so it should not be a problem. -Original Message- From: mech [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:25 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp This problem is new with 4.1.12. For security reasons the invoker servlet had been disabled in the global /conf/web.xml file. This invoker servlet usually loads user servlets that are not mapped correctly as far as i understand. This is done by using a default mapping /servlet/*. In productive systems this should not be done, instead correct mapping is required. In the /examples webapp the invoker servlet had been enabled again with the local web.xml. That's why it's working in examples and not in study. Because in your study web.xml you won't have it enabled manually and thus the default from /conf/web.xml ist used where this feature is disabled. Thus the mapping /servlet/... to servlets is just Tomcat specifically done via the invoker servlet which is now (4.1.12+) disabled by default. But actually you should not need /servlet/ at all, if your mapping is
Re: How to add a servlet to a new Webapp
Curley, Thomas writes: Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1. created webapps/study 2. created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.java and compiled [ok] 3. added the following line to server.xml after the examples /Context Context path=/study docBase=study debug=0 /Context 4. just copied the examples web.xml to study/WEB-INF and added the following lines servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping 5. restart tomcat RESULT - The requested resource (/study/servlet/TestServlet) is not available. Can anyone see what I am missing ? thanks Thomas -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Hello Thomas, i see this all the time on this ml. i don't know what folks' fascination is w/ server.xml and a basic application. yes, this is working 4 u because web.xml is already defined for the webapp /examples. look closer at how the tc folks do it, namely, using the ant build and allowing tc to do its job by creating a .war/.jar combo and letting the tc server (when bounced, autoreload or using the webapp /manager) expand the .war into its very own: $CATALINA_HOME/webapps/ur_application_context/WEB-INF/web.xml and $CATALINA_HOME/webapps/ur_application_context/classes/package_path.../So meServletUbuild.class. pls allow me recommend u look into ant and build.xml. it's worth the trouble if u r serious about tc learning and dev. trying to build anything structured by hand is not recommended. even seasoned vets don't do this because they r the ones that invented this stuff. using ide's r ok (especially when employers require ide use) but i use 3 or 4 tc tools to develop anything i want w/ ease because the chore of structured compilation and deployment is pretty much automatic. hope this help, david. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
MYSTERY SOLVED: RE: How to add a servlet to a new Webapp
The reason is that the invoker servlet is not turned off for the examples. Okay? Check the code and the xml. At 01:06 PM 11/28/2002 +, you wrote: Well I also tried http://localhost:8080/study/servlet/com.wrox.projsp.ch03.TestServlet but the same whereas http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.TestServlet works ?? Thomas -Original Message- From: Collins, Jim [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 13:04 To: 'Tomcat Users List' Subject: RE: How to add a servlet to a new Webapp I believe that servlet has been disabled by default in 4.1.12 for security reasons. That is probably why you can't use: http://localhost:8080/study/servlet/TestServlet Jim -Original Message- From: Curley, Thomas [mailto:[EMAIL PROTECTED]] Sent: 28 November 2002 12:58 To: [EMAIL PROTECTED] Subject: How to add a servlet to a new Webapp Hi All, Using Tomcat 4.1.12 on Win 2K I am getting a 404 error when I try to create a new webapp and add a very basic servlet. The servlet works if I create the package structure within the examples WEB-INF/classes. Here are the steps: 1.created webapps/study 2.created .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav a and compiled [ok] 3.added the following line to server.xml after the examples /Context Context path=/study docBase=study debug=0 /Context 4.just copied the examples web.xml to study/WEB-INF and added the following lines servlet servlet-name TestServlet /servlet-name servlet-class com.wrox.projsp.ch03.TestServlet /servlet-class /servlet servlet-mapping servlet-nameTestServlet/servlet-name url-pattern/TestServlet/url-pattern /servlet-mapping 5.restart tomcat RESULT - The requested resource (/study/servlet/TestServlet) is not available. Can anyone see what I am missing ? thanks Thomas -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] PLEASE READ: The information contained in this email is confidential and intended for the named recipient(s) only. If you are not an intended recipient of this email you must not copy, distribute or take any further action in reliance on it and you should delete it and notify the sender immediately. Email is not a secure method of communication and Nomura International plc cannot accept responsibility for the accuracy or completeness of this message or any attachment(s). Please examine this email for virus infection, for which Nomura International plc accepts no responsibility. If verification of this email is sought then please request a hard copy. Unless otherwise stated any views or opinions presented are solely those of the author and do not represent those of Nomura International plc. This email is intended for informational purposes only and is not a solicitation or offer to buy or sell securities or related financial instruments. Nomura International plc is regulated by the Financial Services Authority and is a member of the London Stock Exchange. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Micael --- This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: MYSTERY SOLVED: RE: How to add a servlet to a new Webapp
i am having the same problem described in this thread what does this (the proposed solution) mean: The reason is that the invoker servlet is not turned off for the examples. Okay? Check the code and the xml. I am migrating from 4.0.3 to 4.1.12. Thanks, Scott -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: MYSTERY SOLVED: RE: How to add a servlet to a new Webapp
You just have to either turn the invoker servlet back on (with security problems, if it is not yet fixed) or use the standard xml way of getting access to the classes. At 04:15 PM 11/28/2002 -0500, you wrote: i am having the same problem described in this thread what does this (the proposed solution) mean: The reason is that the invoker servlet is not turned off for the examples. Okay? Check the code and the xml. I am migrating from 4.0.3 to 4.1.12. Thanks, Scott -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Micael --- This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: How to add a servlet to a new Webapp
* Curley, Thomas [EMAIL PROTECTED] [1114 14:14]: If anyone can explain the web.xml file in plain lang / what filters do and how to get rid of the invoker then please do See the link to chapter 5 at http://www..moreservlets.com -- Rasputin :: Jack of All Trades - Master of Nuns -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]