Re: servlet mappings
Peter Crowther wrote: > 2009/10/30 Caldarale, Charles R : >> 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
2009/10/30 Caldarale, Charles R : > 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
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 wrote: Juha Laiho wrote: ... CfmServlet *.cfm/* 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
Juha Laiho wrote: ... CfmServlet *.cfm/* 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
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 CfmServlet *.cfm/* 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 CfmServlet /first.cfm/* CfmServlet /second.cfm/* ... 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
> 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 > > CfmServlet > *.cfm/* > 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 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 . 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
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" %> >> >> Simple jsp page >> >> >> >> web.xml >> >> > "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" >> "http://java.sun.com/dtd/web-app_2_3.dtd"; > >> >> >> Archetype Created Web Application >> >> >> test >> >> org.springframework.web.servlet.DispatcherServlet >> 1 >> >> >> >>default >>/images/* >> >> >> >>test >>/ >> >> >> >> >> test-servlet.xml >> >> >> > "http://www.springframework.org/dtd/spring-beans.dtd";> >> >> >> > class="org.springframework.web.servlet.mvc.ParameterizableViewController"> >> >> >> >>> class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> >> >> >>testController >> >> >> >> >>> class="org.springframework.web.servlet.view.InternalResourceViewResolver"> >> >>/WEB-INF/jsp/ >> >> >>.jsp >> >> >> >> org.springframework.web.servlet.view.JstlView >> >> >> >> >> >> >> >> >> >> >> >> >> >> 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 '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
"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" %> >> >> Simple jsp page >> >> >> >> web.xml >> >> > "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" >> "http://java.sun.com/dtd/web-app_2_3.dtd"; > >> >> >> Archetype Created Web Application >> >> >> test >> >> org.springframework.web.servlet.DispatcherServlet >> 1 >> >> >> >>default >>/images/* >> >> >> >>test >>/ >> >> >> >> >> test-servlet.xml >> >> >> > "http://www.springframework.org/dtd/spring-beans.dtd";> >> >> >> > class="org.springframework.web.servlet.mvc.ParameterizableViewController"> >> >> >> >>> class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> >> >> >> testController >> >> >> >> >>> class="org.springframework.web.servlet.view.InternalResourceViewResolver"> >> >>/WEB-INF/jsp/ >> >> >>.jsp >> >> >> >> org.springframework.web.servlet.view.JstlView >> >> >> >> >> >> >> >> >> >> >> >> >> >> 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 '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]
RE: Servlet Mappings
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Subject: Re: Servlet Mappings > > >default >/images/* > 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
Heres the web.xml mapping to a simple servlet.. Archetype Created Web Application test Test 1 default /images/* test / The Servlet public class Test extends HttpServlet { protected void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException { httpServletResponse.getWriter().write("\n" + " Simple jsp page\n" + " \n" + ""); 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 element and a docBase > attribute pointing to wherever your .war is? If the .war is also in the > '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
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 element and a docBase attribute pointing to wherever your .war is? If the .war is also in the '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 > > 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 element and a docBase attribute pointing to wherever your .war is? If the .war is also in the '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 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" %> Simple jsp page web.xml http://java.sun.com/dtd/web-app_2_3.dtd"; > Archetype Created Web Application test org.springframework.web.servlet.DispatcherServlet 1 default /images/* test / test-servlet.xml http://www.springframework.org/dtd/spring-beans.dtd";> testController /WEB-INF/jsp/ .jsp org.springframework.web.servlet.view.JstlView 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 '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
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" %> Simple jsp page web.xml http://java.sun.com/dtd/web-app_2_3.dtd"; > Archetype Created Web Application test org.springframework.web.servlet.DispatcherServlet 1 default /images/* test / test-servlet.xml http://www.springframework.org/dtd/spring-beans.dtd";> testController /WEB-INF/jsp/ .jsp org.springframework.web.servlet.view.JstlView 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 '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: Caldarale, Charles R [mailto:[EMAIL PROTECTED] > Subject: RE: Servlet Mappings > > What's the directory structure under ROOT? Is ROOT under > your '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
> 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 '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 > > default > /images > > 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 > > default > /images/* > > 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
Yes I really have a error subdir under the images directory. this is what i see in the access log. 192.168.6.185 - - [30/Oct/2006:15:16:51 +] "GET /images/error/logo.gif HTTP/1.1" 404 1018 192.168.6.185 - - [30/Oct/2006:15:16:51 +] "GET /favicon.ico HTTP/1.1" 302 - 192.168.6.185 - - [30/Oct/2006:15:16:51 +] "GET /favicon.ico HTTP/1.1" 302 - I try moving the logo.gif to under images directory but no joy. My webapp is deployed as ROOT. If I chop all of the mappings out of the web.xml the image is displayed. With default /images alone in the web.xml the image is dispalyed. With default /images/* alone in the web.xml the image is not dispalyed. I have the cache turned off on my browser. How strange. Ben On 10/30/06, Caldarale, Charles R <[EMAIL PROTECTED]> wrote: > 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] - 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
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. testerror /error/* default /images/* test / On 10/30/06, Caldarale, Charles R <[EMAIL PROTECTED]> wrote: > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Subject: Servlet Mappings > > > testerror > /error/* > The above is correct; note the trailing "/*". > > test > / > This one says to send everything that doesn't match something else to the "test" servlet. > > default > /images > This one is missing the trailing "/*". > > default > /css > 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. > > default > /js > 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: Servlet Mappings > > > testerror > /error/* > The above is correct; note the trailing "/*". > > test > / > This one says to send everything that doesn't match something else to the "test" servlet. > > default > /images > This one is missing the trailing "/*". > > default > /css > 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. > > default > /js > 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
Ben, > With this setup requests that start with /error go to the testerror > servlet, all other requests go to the test servlet. Just a guess, but I would try putting this catch-all servlet mapping: test / at the end of the mappings. Or at the beginning if that doesn't work. I'm guessing that Tomcat keeps these mappings as a list and iterates over them looking for a match. Maybe the first match wins? If you think about this like a switch statement, your catch-all case should be at the bottom of the list. -chris signature.asc Description: OpenPGP digital signature