FW: My very first servlet cannot be run
Hi there, I have got an issue running a very first servlet on tomcat5. The valid Servlet code for Log4jTester : package test; public class Log4jTester { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } } The valid 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-namePatrickWorkspace/display-name descriptionThis is the Patrick workspace/description servlet servlet-namelog4j/servlet-name servlet-classtest.Log4jTester/servlet-class /servlet servlet-mapping servlet-namelog4j/servlet-name url-pattern/log4j/url-pattern /servlet-mapping /web-app The valid log4j.html HTML HEAD TITLE log4jtest /TITLE HEAD BODY FORM TYPE = submit ACTION=/test.Log4jTester METHOD=GET CENTER INPUT TYPE=submit NAME=submit VALUE=go /CENTER /FORM /BODY /HTML The valid index.html HTML HEAD /HEAD BODY A HREF = html/log4j.html log4j /A /BODY /HTML Deployment: The deployment works fine. Tomcat manager lists the PatrickWorkSpace. PatrickWorkSpace opens the index.html. Index.html opens the log4j.html Clicking the Go button on log4j.html results in following error HTTP Status 404 - /PatrickWorkSpace/test.Log4jTester type Status report message /PatrickWorkSpace/test.Log4jTester description The requested resource (/PatrickWorkSpace/test.Log4jTester) is not available. I hope anyone can give me some good hints and tips. Patrick. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FW: My very first servlet cannot be run
Hi Patrick, You use should use the servlet name you specified rather than the class name. Do you need the servlet-mapping as well ? Here's a example from tomcat: http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/webapps/admin/WEB-INF/web.xml?view=markup Van Den Bemt, Patrick (P.) wrote: Hi there, I have got an issue running a very first servlet on tomcat5. The valid Servlet code for Log4jTester : package test; public class Log4jTester { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } } The valid 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-namePatrickWorkspace/display-name descriptionThis is the Patrick workspace/description servlet servlet-namelog4j/servlet-name servlet-classtest.Log4jTester/servlet-class /servlet servlet-mapping servlet-namelog4j/servlet-name url-pattern/log4j/url-pattern /servlet-mapping /web-app The valid log4j.html HTML HEAD TITLE log4jtest /TITLE HEAD BODY FORM TYPE = submit ACTION=/test.Log4jTester METHOD=GET CENTER INPUT TYPE=submit NAME=submit VALUE=go /CENTER /FORM /BODY /HTML The valid index.html HTML HEAD /HEAD BODY A HREF = html/log4j.html log4j /A /BODY /HTML Deployment: The deployment works fine. Tomcat manager lists the PatrickWorkSpace. PatrickWorkSpace opens the index.html. Index.html opens the log4j.html Clicking the Go button on log4j.html results in following error HTTP Status 404 - /PatrickWorkSpace/test.Log4jTester type Status report message /PatrickWorkSpace/test.Log4jTester description The requested resource (/PatrickWorkSpace/test.Log4jTester) is not available. I hope anyone can give me some good hints and tips. Patrick. - 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: FW: My very first servlet cannot be run
Hi Patrick, I suppose that your compiled Log4jTester in the test package is under this directory: C:\tomcat-5.x/webapps/ROOT/WEB-INF/classes The mapping in the web.xml file should be: servlet servlet-namelog4j/servlet-name servlet-classtest.Log4jTester/servlet-class /servlet servlet-mapping servlet-namelog4j/servlet-name url-pattern/servlet/test.Log4jTester/url-pattern /servlet-mapping /web-app In the IE browser, type in http://localhost:8080/servlet/test.Log4jTester try it out. Let us know if you have further problems. --- Van Den Bemt, Patrick (P.) [EMAIL PROTECTED] wrote: Hi there, I have got an issue running a very first servlet on tomcat5. The valid Servlet code for Log4jTester : package test; public class Log4jTester { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } } The valid 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-namePatrickWorkspace/display-name descriptionThis is the Patrick workspace/description servlet servlet-namelog4j/servlet-name servlet-classtest.Log4jTester/servlet-class /servlet servlet-mapping servlet-namelog4j/servlet-name url-pattern/log4j/url-pattern /servlet-mapping /web-app The valid log4j.html HTML HEAD TITLE log4jtest /TITLE HEAD BODY FORM TYPE = submit ACTION=/test.Log4jTester METHOD=GET CENTER INPUT TYPE=submit NAME=submit VALUE=go /CENTER /FORM /BODY /HTML The valid index.html HTML HEAD /HEAD BODY A HREF = html/log4j.html log4j /A /BODY /HTML Deployment: The deployment works fine. Tomcat manager lists the PatrickWorkSpace. PatrickWorkSpace opens the index.html. Index.html opens the log4j.html Clicking the Go button on log4j.html results in following error HTTP Status 404 - /PatrickWorkSpace/test.Log4jTester type Status report message /PatrickWorkSpace/test.Log4jTester description The requested resource (/PatrickWorkSpace/test.Log4jTester) is not available. I hope anyone can give me some good hints and tips. Patrick. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]