Re: servlet mappings
Peter Crowther wrote: 2009/10/30 Caldarale, Charles R chuck.caldar...@unisys.com: Note that several servlet containers silently implement enhancements to the spec that simply cause confusion and limit portability. ... and are handy for some real-world use cases, such as creating a RESTful web service without the overhead of Axis or within a different language such as Cold Fusion. Tomcat, through its required spec compliance, is limiting its market. Of course, this may or may not be A Bad Thing, depending on your point of view - but where I'm on mailing lists for products that *use* a servlet container, none recommend Tomcat and in some cases there are groans on-list when someone asks a question about product deployment in Tomcat. What products and what is the source of the complaints? You never know, it might be stuff that is fairly easy to address. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: servlet mappings
Juha Laiho wrote: ... servlet-mapping id=coldfusion_mapping_6 servlet-nameCfmServlet/servlet-name url-pattern*.cfm/*/url-pattern /servlet-mapping I don't think the above mapping is valid. Seconded, and tried a few variations with Tomcat to verify my expectations. One way would be to explicitly declare all different .cfm prefixes, like I agree with what you are both saying of course, and that's how the Servlet Spec is. But has not one of the Tomcat gurus lurking on this forum ever questioned why that is so, and asked the authorities who create the Servlet Spec why they thought it smart to create their own bizarre type of wildcard matching, as opposed to adopting some well-established one such as the shell's filespec wildcards or regexp's ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: servlet mappings
yeah, that what surprised mr. that someone would design something that looks so much like a wildcats, but actually it's not On 31 Oct 2009, at 09:08, André Warnier a...@ice-sa.com wrote: Juha Laiho wrote: ... servlet-mapping id=coldfusion_mapping_6 servlet-nameCfmServlet/servlet-name url-pattern*.cfm/*/url-pattern /servlet-mapping I don't think the above mapping is valid. Seconded, and tried a few variations with Tomcat to verify my expectations. One way would be to explicitly declare all different .cfm prefixes, like I agree with what you are both saying of course, and that's how the Servlet Spec is. But has not one of the Tomcat gurus lurking on this forum ever questioned why that is so, and asked the authorities who create the Servlet Spec why they thought it smart to create their own bizarre type of wildcard matching, as opposed to adopting some well- established one such as the shell's filespec wildcards or regexp's ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: servlet mappings
2009/10/30 Caldarale, Charles R chuck.caldar...@unisys.com: Note that several servlet containers silently implement enhancements to the spec that simply cause confusion and limit portability. ... and are handy for some real-world use cases, such as creating a RESTful web service without the overhead of Axis or within a different language such as Cold Fusion. Tomcat, through its required spec compliance, is limiting its market. Of course, this may or may not be A Bad Thing, depending on your point of view - but where I'm on mailing lists for products that *use* a servlet container, none recommend Tomcat and in some cases there are groans on-list when someone asks a question about product deployment in Tomcat. - Peter - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: servlet mappings
From: Chris Blackwell [mailto:ch...@team193.com] Subject: servlet mappings Coldfusion 9's web.xml ships with the following servelt-mapping, but it doesn't seem to work on Tomcat servlet-mapping id=coldfusion_mapping_6 servlet-nameCfmServlet/servlet-name url-pattern*.cfm/*/url-pattern /servlet-mapping I don't think the above mapping is valid. To quote from the servlet spec: In the Web application deployment descriptor, the following syntax is used to define mappings: * A string beginning with a '/' character and ending with a '/*' suffix is used for path mapping. * A string beginning with a '*.' prefix is used as an extension mapping. * A string containing only the '/' character indicates the default servlet of the application. In this case the servlet path is the request URI minus the context path and the path info is null. * All other strings are used for exact matches only. As I understand it, the asterisks are /not/ wildcards; they're just markers in the syntax. The url-pattern above falls under the second bullet, but there certainly can't be any extensions that have a slash in them. If your URLs end in .cfm, just remove the /* from the url-pattern. If you actually have URLs with a / following the .cfm, you may need to make that servlet the default one. Note that several servlet containers silently implement enhancements to the spec that simply cause confusion and limit portability. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: servlet mappings
Caldarale, Charles R wrote: From: Chris Blackwell [mailto:ch...@team193.com] Subject: servlet mappings Coldfusion 9's web.xml ships with the following servlet-mapping, but it doesn't seem to work on Tomcat servlet-mapping id=coldfusion_mapping_6 servlet-nameCfmServlet/servlet-name url-pattern*.cfm/*/url-pattern /servlet-mapping I don't think the above mapping is valid. Seconded, and tried a few variations with Tomcat to verify my expectations. One way would be to explicitly declare all different .cfm prefixes, like servlet-mapping servlet-nameCfmServlet/servlet-name url-pattern/first.cfm/*/url-pattern /servlet-mapping servlet-mapping servlet-nameCfmServlet/servlet-name url-pattern/second.cfm/*/url-pattern /servlet-mapping ... and so on. But then, I've never worked with CF, so cannot tell whether this approach makes any sense in that context. -- ..Juha - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Servlet Mappings
Many thanks for your help Charles. On 10/31/06, Bill Barker [EMAIL PROTECTED] wrote: ben short [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I just tried changing the /images/* to *.jpg and it works Yes, Tomcat's default servlet won't work with a prefix map. It requires either a suffex map, or a default map. On 10/30/06, ben short [EMAIL PROTECTED] wrote: Charles, Im deploying a war file. Im also using spring. I havent touched the web.xml. I have litrally downloaded and un tared the file from the apache tomcat website. Here is the layout of the test app;lication i have setup to try it out. test - images - test.jpg - WEB-INF - web.xml - test-servlet.xml - jsp - test.jsp - lib - various jars - tld - c-1.1.2.tld - fmt-1.1.2.tld test.jsp %@ page contentType=text/html;charset=UTF-8 language=java % html headtitleSimple jsp page/title/head bodyimg src=images/test.jpg alt= //body /html web.xml !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-nameArchetype Created Web Application/display-name servlet servlet-nametest/servlet-name servlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-namedefault/servlet-name url-pattern/images/*/url-pattern /servlet-mapping servlet-mapping servlet-nametest/servlet-name url-pattern//url-pattern /servlet-mapping /web-app test-servlet.xml ?xml version=1.0 encoding=UTF-8? !DOCTYPE beans PUBLIC -//SPRING//DTD BEAN//EN http://www.springframework.org/dtd/spring-beans.dtd; beans bean id=testController class=org.springframework.web.servlet.mvc.ParameterizableViewController property name=viewName value=test/ /bean bean id=urlMapping class=org.springframework.web.servlet.handler.SimpleUrlHandlerMapping property name=mappings props prop key=/test.htmltestController/prop /props /property /bean bean id=viewResolver class=org.springframework.web.servlet.view.InternalResourceViewResolver property name=prefix value/WEB-INF/jsp//value /property property name=suffix value.jsp/value /property property name=viewClass valueorg.springframework.web.servlet.view.JstlView/value /property /bean /beans On 10/30/06, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Subject: RE: Servlet Mappings What's the directory structure under ROOT? Is ROOT under your Host's appBase? For that matter, what's the directory structure under appBase? Should have mentioned that your images directory should be under ROOT, not appBase. If it's under appBase, images is being deployed as a separate webapp, which is probably not your intent. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet Mappings
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: Servlet Mappings servlet-mapping servlet-nametesterror/servlet-name url-pattern/error/*/url-pattern /servlet-mapping The above is correct; note the trailing /*. servlet-mapping servlet-nametest/servlet-name url-pattern//url-pattern /servlet-mapping This one says to send everything that doesn't match something else to the test servlet. servlet-mapping servlet-namedefault/servlet-name url-pattern/images/url-pattern /servlet-mapping This one is missing the trailing /*. servlet-mapping servlet-namedefault/servlet-name url-pattern/css/url-pattern /servlet-mapping Is this intended to send only items from the css directory to the default servlet? If so, then you're missing the trailing /*. If you want to send all .css files to the default, use *.css, with no slashes. servlet-mapping servlet-namedefault/servlet-name url-pattern/js/url-pattern /servlet-mapping Similar to the css one: you need a trailing /* or it should be *.js*. Order of servlet mappings is not important - the spec requires that the container honor the longest match first. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet Mappings
Hi, I changed the mapping to as follows but no joy. Although the problem seems to of changed slightly. When I try to request an images http://myhost/images/error/logo.gif i get a 404. I have double checked and the image is definatly in the correct location. servlet-mapping servlet-nametesterror/servlet-name url-pattern/error/*/url-pattern /servlet-mapping servlet-mapping servlet-namedefault/servlet-name url-pattern/images/*/url-pattern /servlet-mapping servlet-mapping servlet-nametest/servlet-name url-pattern//url-pattern /servlet-mapping On 10/30/06, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: Servlet Mappings servlet-mapping servlet-nametesterror/servlet-name url-pattern/error/*/url-pattern /servlet-mapping The above is correct; note the trailing /*. servlet-mapping servlet-nametest/servlet-name url-pattern//url-pattern /servlet-mapping This one says to send everything that doesn't match something else to the test servlet. servlet-mapping servlet-namedefault/servlet-name url-pattern/images/url-pattern /servlet-mapping This one is missing the trailing /*. servlet-mapping servlet-namedefault/servlet-name url-pattern/css/url-pattern /servlet-mapping Is this intended to send only items from the css directory to the default servlet? If so, then you're missing the trailing /*. If you want to send all .css files to the default, use *.css, with no slashes. servlet-mapping servlet-namedefault/servlet-name url-pattern/js/url-pattern /servlet-mapping Similar to the css one: you need a trailing /* or it should be *.js*. Order of servlet mappings is not important - the spec requires that the container honor the longest match first. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet Mappings
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: Re: Servlet Mappings I changed the mapping to as follows but no joy. Although the problem seems to of changed slightly. When I try to request an images http://myhost/images/error/logo.gif i get a 404. I have double checked and the image is definatly in the correct location. You really have an error subdirectory under images? What happens if you try to get an image that's directly in the images directory? What is the directory structure of your webapp? What do the logs show? You might want to turn on the AccessLogValve to see what's really being requested. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet Mappings
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: Re: Servlet Mappings My webapp is deployed as ROOT. What's the directory structure under ROOT? Is ROOT under your Host's appBase? For that matter, what's the directory structure under appBase? If I chop all of the mappings out of the web.xml the image is displayed. With servlet-mapping servlet-namedefault/servlet-name url-pattern/images/url-pattern /servlet-mapping alone in the web.xml the image is dispalyed. I suspect that's because the DefaultServlet in conf/web.xml is handling the request in both of the above cases. With servlet-mapping servlet-namedefault/servlet-name url-pattern/images/*/url-pattern /servlet-mapping alone in the web.xml the image is not dispalyed. Have you changed conf/web.xml at all? Could there be any other mappings in there getting in the way? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet Mappings
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Subject: RE: Servlet Mappings What's the directory structure under ROOT? Is ROOT under your Host's appBase? For that matter, what's the directory structure under appBase? Should have mentioned that your images directory should be under ROOT, not appBase. If it's under appBase, images is being deployed as a separate webapp, which is probably not your intent. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet Mappings
Charles, Im deploying a war file. Im also using spring. I havent touched the web.xml. I have litrally downloaded and un tared the file from the apache tomcat website. Here is the layout of the test app;lication i have setup to try it out. test - images - test.jpg - WEB-INF - web.xml - test-servlet.xml - jsp - test.jsp - lib - various jars - tld - c-1.1.2.tld - fmt-1.1.2.tld test.jsp %@ page contentType=text/html;charset=UTF-8 language=java % html headtitleSimple jsp page/title/head bodyimg src=images/test.jpg alt= //body /html web.xml !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-nameArchetype Created Web Application/display-name servlet servlet-nametest/servlet-name servlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-namedefault/servlet-name url-pattern/images/*/url-pattern /servlet-mapping servlet-mapping servlet-nametest/servlet-name url-pattern//url-pattern /servlet-mapping /web-app test-servlet.xml ?xml version=1.0 encoding=UTF-8? !DOCTYPE beans PUBLIC -//SPRING//DTD BEAN//EN http://www.springframework.org/dtd/spring-beans.dtd; beans bean id=testController class=org.springframework.web.servlet.mvc.ParameterizableViewController property name=viewName value=test/ /bean bean id=urlMapping class=org.springframework.web.servlet.handler.SimpleUrlHandlerMapping property name=mappings props prop key=/test.htmltestController/prop /props /property /bean bean id=viewResolver class=org.springframework.web.servlet.view.InternalResourceViewResolver property name=prefix value/WEB-INF/jsp//value /property property name=suffix value.jsp/value /property property name=viewClass valueorg.springframework.web.servlet.view.JstlView/value /property /bean /beans On 10/30/06, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Subject: RE: Servlet Mappings What's the directory structure under ROOT? Is ROOT under your Host's appBase? For that matter, what's the directory structure under appBase? Should have mentioned that your images directory should be under ROOT, not appBase. If it's under appBase, images is being deployed as a separate webapp, which is probably not your intent. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet Mappings
I just tried changing the /images/* to *.jpg and it works On 10/30/06, ben short [EMAIL PROTECTED] wrote: Charles, Im deploying a war file. Im also using spring. I havent touched the web.xml. I have litrally downloaded and un tared the file from the apache tomcat website. Here is the layout of the test app;lication i have setup to try it out. test - images - test.jpg - WEB-INF - web.xml - test-servlet.xml - jsp - test.jsp - lib - various jars - tld - c-1.1.2.tld - fmt-1.1.2.tld test.jsp %@ page contentType=text/html;charset=UTF-8 language=java % html headtitleSimple jsp page/title/head bodyimg src=images/test.jpg alt= //body /html web.xml !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-nameArchetype Created Web Application/display-name servlet servlet-nametest/servlet-name servlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-namedefault/servlet-name url-pattern/images/*/url-pattern /servlet-mapping servlet-mapping servlet-nametest/servlet-name url-pattern//url-pattern /servlet-mapping /web-app test-servlet.xml ?xml version=1.0 encoding=UTF-8? !DOCTYPE beans PUBLIC -//SPRING//DTD BEAN//EN http://www.springframework.org/dtd/spring-beans.dtd; beans bean id=testController class=org.springframework.web.servlet.mvc.ParameterizableViewController property name=viewName value=test/ /bean bean id=urlMapping class=org.springframework.web.servlet.handler.SimpleUrlHandlerMapping property name=mappings props prop key=/test.htmltestController/prop /props /property /bean bean id=viewResolver class=org.springframework.web.servlet.view.InternalResourceViewResolver property name=prefix value/WEB-INF/jsp//value /property property name=suffix value.jsp/value /property property name=viewClass valueorg.springframework.web.servlet.view.JstlView/value /property /bean /beans On 10/30/06, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Subject: RE: Servlet Mappings What's the directory structure under ROOT? Is ROOT under your Host's appBase? For that matter, what's the directory structure under appBase? Should have mentioned that your images directory should be under ROOT, not appBase. If it's under appBase, images is being deployed as a separate webapp, which is probably not your intent. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet Mappings
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: Re: Servlet Mappings Im deploying a war file. Im also using spring. I havent touched the web.xml. I have litrally downloaded and un tared the file from the apache tomcat website. I'm not familiar with configuring spring, so someone else will have to check that. I suspect it's muddying up the picture. Here is the layout of the test app;lication i have setup to try it out. That looks o.k. as far as it goes, but you didn't tell us where it's actually deployed, nor how you think you got it to be ROOT. Do you have a conf/[engine]/[host]/ROOT.xml with a Context element and a docBase attribute pointing to wherever your .war is? If the .war is also in the Host's appBase directory, you've deployed the app twice, which is probably not desirable. So again, what is your appBase set to? What's the directory structure underneath the appBase? What URL do you use to trigger execution of the test.jsp file? Can you try this without using spring? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet Mappings
I deploy this test webapp via the tomcat manager to http://myhost/test. The appBase in the sever.xml is set, as default, to webapps. The directory structure is webapps - ROOT - Currently another applicaiton I have setup. - test - The test application. When deploying to the root, just name the war file ROOT.xml the rest of the server is configured as default. To url to trigger the jsp is http://myhost/test/test.html. Im just knocking up a servlet to do the same thing to remove spring from the picture. Ben On 10/30/06, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: Re: Servlet Mappings Im deploying a war file. Im also using spring. I havent touched the web.xml. I have litrally downloaded and un tared the file from the apache tomcat website. I'm not familiar with configuring spring, so someone else will have to check that. I suspect it's muddying up the picture. Here is the layout of the test app;lication i have setup to try it out. That looks o.k. as far as it goes, but you didn't tell us where it's actually deployed, nor how you think you got it to be ROOT. Do you have a conf/[engine]/[host]/ROOT.xml with a Context element and a docBase attribute pointing to wherever your .war is? If the .war is also in the Host's appBase directory, you've deployed the app twice, which is probably not desirable. So again, what is your appBase set to? What's the directory structure underneath the appBase? What URL do you use to trigger execution of the test.jsp file? Can you try this without using spring? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet Mappings
Heres the web.xml mapping to a simple servlet.. web-app display-nameArchetype Created Web Application/display-name servlet servlet-nametest/servlet-name servlet-classTest/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-namedefault/servlet-name url-pattern/images/*/url-pattern /servlet-mapping servlet-mapping servlet-nametest/servlet-name url-pattern//url-pattern /servlet-mapping /web-app The Servlet public class Test extends HttpServlet { protected void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException { httpServletResponse.getWriter().write(html\n + headtitleSimple jsp page/title/head\n + bodyimg src=\images/test.jpg\ alt=\\ //body\n + /html); httpServletResponse.getWriter().flush(); } } The webapp was deploed to http://myhost/test via the tomcat manger webapp. On going to the http://myhost/test url the webpage is shown but no image. Going to http://myhost/test/images/test.jpg give a 404. Ben On 10/30/06, ben short [EMAIL PROTECTED] wrote: I deploy this test webapp via the tomcat manager to http://myhost/test. The appBase in the sever.xml is set, as default, to webapps. The directory structure is webapps - ROOT - Currently another applicaiton I have setup. - test - The test application. When deploying to the root, just name the war file ROOT.xml the rest of the server is configured as default. To url to trigger the jsp is http://myhost/test/test.html. Im just knocking up a servlet to do the same thing to remove spring from the picture. Ben On 10/30/06, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: Re: Servlet Mappings Im deploying a war file. Im also using spring. I havent touched the web.xml. I have litrally downloaded and un tared the file from the apache tomcat website. I'm not familiar with configuring spring, so someone else will have to check that. I suspect it's muddying up the picture. Here is the layout of the test app;lication i have setup to try it out. That looks o.k. as far as it goes, but you didn't tell us where it's actually deployed, nor how you think you got it to be ROOT. Do you have a conf/[engine]/[host]/ROOT.xml with a Context element and a docBase attribute pointing to wherever your .war is? If the .war is also in the Host's appBase directory, you've deployed the app twice, which is probably not desirable. So again, what is your appBase set to? What's the directory structure underneath the appBase? What URL do you use to trigger execution of the test.jsp file? Can you try this without using spring? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet Mappings
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: Re: Servlet Mappings servlet-mapping servlet-namedefault/servlet-name url-pattern/images/*/url-pattern /servlet-mapping Thanks for the example. With that, turning on debugging, and looking at the code in DefaultServlet.java, I finally figured out what's going on. Turns out the standard DefaultServlet is designed to execute only with a path mapping of /. It can also use extension mappings, but only those without any prefix - which is why your *.jpg mapping worked. The standard DefaultServlet uses HttpServletRequest.getPathInfo(), which is defined to return only extra path information - that which is beyond the mapping that selected the servlet. So, with the /images/* pattern and a URL of /test/images/test.jpg, the DefaultServlet went looking for /test.jpg, and returned the 404 when it couldn't be found. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet Mappings
ben short [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I just tried changing the /images/* to *.jpg and it works Yes, Tomcat's default servlet won't work with a prefix map. It requires either a suffex map, or a default map. On 10/30/06, ben short [EMAIL PROTECTED] wrote: Charles, Im deploying a war file. Im also using spring. I havent touched the web.xml. I have litrally downloaded and un tared the file from the apache tomcat website. Here is the layout of the test app;lication i have setup to try it out. test - images - test.jpg - WEB-INF - web.xml - test-servlet.xml - jsp - test.jsp - lib - various jars - tld - c-1.1.2.tld - fmt-1.1.2.tld test.jsp %@ page contentType=text/html;charset=UTF-8 language=java % html headtitleSimple jsp page/title/head bodyimg src=images/test.jpg alt= //body /html web.xml !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-nameArchetype Created Web Application/display-name servlet servlet-nametest/servlet-name servlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-namedefault/servlet-name url-pattern/images/*/url-pattern /servlet-mapping servlet-mapping servlet-nametest/servlet-name url-pattern//url-pattern /servlet-mapping /web-app test-servlet.xml ?xml version=1.0 encoding=UTF-8? !DOCTYPE beans PUBLIC -//SPRING//DTD BEAN//EN http://www.springframework.org/dtd/spring-beans.dtd; beans bean id=testController class=org.springframework.web.servlet.mvc.ParameterizableViewController property name=viewName value=test/ /bean bean id=urlMapping class=org.springframework.web.servlet.handler.SimpleUrlHandlerMapping property name=mappings props prop key=/test.htmltestController/prop /props /property /bean bean id=viewResolver class=org.springframework.web.servlet.view.InternalResourceViewResolver property name=prefix value/WEB-INF/jsp//value /property property name=suffix value.jsp/value /property property name=viewClass valueorg.springframework.web.servlet.view.JstlView/value /property /bean /beans On 10/30/06, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Subject: RE: Servlet Mappings What's the directory structure under ROOT? Is ROOT under your Host's appBase? For that matter, what's the directory structure under appBase? Should have mentioned that your images directory should be under ROOT, not appBase. If it's under appBase, images is being deployed as a separate webapp, which is probably not your intent. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]