Re: Easy Servlet Question
I have some demo apps on http://simple.souther.us that you can run. They're all war files so all you have to do is download to your webapps directory. SimpleServlet.war is your basic "Hello, World" app in a servlet. On Mon, 2005-10-03 at 21:49, Andrew Pierce wrote: > Hello. I realize this is about the stupidest question I could ask but, > I've scoured the web, etc. and cannot get an easy example of making > servlets actually work with Tomcat. > > I have written a few "Hello World" servlets and gotten them to work with > Resin but I cannot get even the most simple servlet to work with Tomcat. > > I create the servlet code such as the one found here: > > http://www.caucho.com/resin-3.0/servlet/tutorial/helloworld/index.xtp > > I compile the servlet and place the .class file in the > $CATALINA_HOME/webapps//WEB-INF/classes directory. > > Then I modify the $CATALINA_HOME/webapps/app/WEB-INF/web.xml to include > the declarations for the servlet. > > I stop and restart Tomcat and alas, all I get is 404 when I try to > access the servlet with a url like > http://localhost:8080//HelloServlet. > > I know this has got to VERY simple. Thanks in advance. > Andrew > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Ben Souther F.W. Davison & Co. CONFIDENTIALITY NOTICE: This e-mail message, and any accompanying documents, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure, distribution or copying is prohibited. If you are not the intended recipient, please contact our office by email or by telephone at (508) 747-7261 and immediately destroy all copies of the original message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Easy Servlet Question
What is u r declaration in web.xml file. If you give any alias name then you have to use that in u r URL. http://localhost:8080//anyaliasname. Parthi On 10/3/05, Andrew Pierce <[EMAIL PROTECTED]> wrote: > > Hello. I realize this is about the stupidest question I could ask but, > I've scoured the web, etc. and cannot get an easy example of making > servlets actually work with Tomcat. > > I have written a few "Hello World" servlets and gotten them to work with > Resin but I cannot get even the most simple servlet to work with Tomcat. > > I create the servlet code such as the one found here: > > http://www.caucho.com/resin-3.0/servlet/tutorial/helloworld/index.xtp > > I compile the servlet and place the .class file in the > $CATALINA_HOME/webapps//WEB-INF/classes directory. > > Then I modify the $CATALINA_HOME/webapps/app/WEB-INF/web.xml to include > the declarations for the servlet. > > I stop and restart Tomcat and alas, all I get is 404 when I try to > access the servlet with a url like > http://localhost:8080//HelloServlet. > > I know this has got to VERY simple. Thanks in advance. > Andrew > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: Easy Servlet Question
OK. This was a bit of a simple one. Found my answer with the help of a couple of folks on IRC. Please disregard. Andrew Pierce wrote: Hello. I realize this is about the stupidest question I could ask but, I've scoured the web, etc. and cannot get an easy example of making servlets actually work with Tomcat. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Easy Servlet Question
Hello. I realize this is about the stupidest question I could ask but, I've scoured the web, etc. and cannot get an easy example of making servlets actually work with Tomcat. I have written a few "Hello World" servlets and gotten them to work with Resin but I cannot get even the most simple servlet to work with Tomcat. I create the servlet code such as the one found here: http://www.caucho.com/resin-3.0/servlet/tutorial/helloworld/index.xtp I compile the servlet and place the .class file in the $CATALINA_HOME/webapps//WEB-INF/classes directory. Then I modify the $CATALINA_HOME/webapps/app/WEB-INF/web.xml to include the declarations for the servlet. I stop and restart Tomcat and alas, all I get is 404 when I try to access the servlet with a url like http://localhost:8080//HelloServlet. I know this has got to VERY simple. Thanks in advance. Andrew - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Easy /servlet question
Thanks, Paul. Problem (mystery) solved. - Original Message - From: "Lee, Paul NYC" <[EMAIL PROTECTED]> To: "'Tomcat Users List'" <[EMAIL PROTECTED]> Sent: Wednesday, June 23, 2004 4:51 PM Subject: RE: Easy /servlet question > Tomcat 3.x allowed access to servlets under a common mapping (/servlet/*) by > default. In Tomcat 4.x the developers stopped this behavior by default. > This was done by the invoker servlet. > > To enable this, under $CATALINA_HOME/conf, modify the web.xml file. Search > for "invoker" and you should find something like this: > > > > > Just uncomment and it should work. Note that "/servlet/" is no longer part > of the specification as of 2.3. Mapping it is recommended. > > Regards, > Paul > > -Original Message- > From: e-Denton Subscriber [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 23, 2004 4:29 PM > To: [EMAIL PROTECTED] > Subject: Easy /servlet question > > > I have a very simple question, to which neither I nor my wife can find the > answer. > > My servlet is in the WEB-INF/classes directory of my application directory. > For some reason, I can't get this simple construction--it's in all the JSP > books--to work: > > http://127.0.0.1:8080/e-Denton/servlet/Upload_CnW > > > I get this error: > > HTTP Status 404 - /e-Denton/servlet/Upload_CnW > message /e-Denton/servlet/Upload_CnW > description The requested resource (/e-Denton/servlet/Upload_CnW) is not > available. > > I can get it to wotk with a sevlet mapping, but not without it. > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Easy /servlet question
Tomcat 3.x allowed access to servlets under a common mapping (/servlet/*) by default. In Tomcat 4.x the developers stopped this behavior by default. This was done by the invoker servlet. To enable this, under $CATALINA_HOME/conf, modify the web.xml file. Search for "invoker" and you should find something like this: Just uncomment and it should work. Note that "/servlet/" is no longer part of the specification as of 2.3. Mapping it is recommended. Regards, Paul -Original Message- From: e-Denton Subscriber [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 23, 2004 4:29 PM To: [EMAIL PROTECTED] Subject: Easy /servlet question I have a very simple question, to which neither I nor my wife can find the answer. My servlet is in the WEB-INF/classes directory of my application directory. For some reason, I can't get this simple construction--it's in all the JSP books--to work: http://127.0.0.1:8080/e-Denton/servlet/Upload_CnW I get this error: HTTP Status 404 - /e-Denton/servlet/Upload_CnW message /e-Denton/servlet/Upload_CnW description The requested resource (/e-Denton/servlet/Upload_CnW) is not available. I can get it to wotk with a sevlet mapping, but not without it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Easy /servlet question
You must specify your servlet in the web.xml file. This is how Tomcat knows what to do when you ask it for Upload_CnW. This might be unnecessary to mention, but you also have to compile your class before launching Tomcat. Anything else would just be shots in the dark, since you haven't really told us what you wanted to know and detailed your situation enough. -Original Message- From: e-Denton Subscriber [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 23, 2004 4:29 PM To: [EMAIL PROTECTED] Subject: Easy /servlet question I have a very simple question, to which neither I nor my wife can find the answer. My servlet is in the WEB-INF/classes directory of my application directory. For some reason, I can't get this simple construction--it's in all the JSP books--to work: http://127.0.0.1:8080/e-Denton/servlet/Upload_CnW I get this error: HTTP Status 404 - /e-Denton/servlet/Upload_CnW message /e-Denton/servlet/Upload_CnW description The requested resource (/e-Denton/servlet/Upload_CnW) is not available. I can get it to wotk with a sevlet mapping, but not without it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Easy /servlet question
I have a very simple question, to which neither I nor my wife can find the answer. My servlet is in the WEB-INF/classes directory of my application directory. For some reason, I can't get this simple construction--it's in all the JSP books--to work: http://127.0.0.1:8080/e-Denton/servlet/Upload_CnW I get this error: HTTP Status 404 - /e-Denton/servlet/Upload_CnW message /e-Denton/servlet/Upload_CnW description The requested resource (/e-Denton/servlet/Upload_CnW) is not available. I can get it to wotk with a sevlet mapping, but not without it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]