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
servlet mappings
I'm trying to get basic SES urls working, in the form of http://mysite.dev/index.cfm/foo/1/bar/2 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 just end up with 404's. Anyone suggest a way to achieve this? Chris
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
context.xml locations and servlet mappings
Hi, I am experiencing a weird problem; when configuring my context in META-INF/context.xml, the servlet mappings stop working. I am trying to migrate web applications setup to run on Tomcat 5.0 to Tomcat 5.5 or 6. Currently one or more contexts are configured inside a host in server.xml. When I try moving these contexts in META-INF/context.xml, the servlet mappings in web.xml stop working and I can't figure out where the problem is. If I put the context back to server.xml, the mappings work fine and pages display correctly. Any help will be appreciated. web.xml ... servlet-mapping servlet-namemyServlet/servlet-name url-pattern*.html/url-pattern /servlet-mapping ... Server.xml Host name=hostname appBase=C:\projects\myApp .../ META-INF/context.xml Context path= docBase=html debug=0 privileged=true /Context Also tried Context docBase=html debug=0 privileged=true /Context The WEB-INF and META-INF are in C:\projects\myApp\html I am also not sure what is correct location for META-INF. Thanks, Ross This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - 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: context.xml locations and servlet mappings
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ross, Angelov, Rossen wrote: META-INF/context.xml Context path= docBase=html debug=0 privileged=true Take out the path and docBase parameters. They are either illegal or ill-advised when using META-INF/context.xml. This might not be /the/ problem, but you should definitely remove those two attributes. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGZIgZ9CaO5/Lv0PARAoQoAKCIs1myORR5N3hhQAaBcEsyOZmi6ACfXMrx HUvaShUKZFwX385E0A1dq98= =3Rfo -END PGP SIGNATURE- - 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: context.xml locations and servlet mappings
Chris, This didn't help. Removing them is not generating errors, the servlet still loads on startup, but then the mapping don't work. It doesn't make sense to remove the path and the docBase. Especially the docBase, it specifies the Context Root. If it's empty, it probably uses the host appBase for root, but this is incorrect. I should be able to specify the context root. What about the cases when there are more than one contexts per host? The problem seems to be somewhere else, but thanks for the advise. Ross -Original Message- From: Christopher Schultz [mailto:[EMAIL PROTECTED] Sent: Monday, June 04, 2007 4:46 PM To: Tomcat Users List Subject: Re: context.xml locations and servlet mappings -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ross, Angelov, Rossen wrote: META-INF/context.xml Context path= docBase=html debug=0 privileged=true Take out the path and docBase parameters. They are either illegal or ill-advised when using META-INF/context.xml. This might not be /the/ problem, but you should definitely remove those two attributes. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGZIgZ9CaO5/Lv0PARAoQoAKCIs1myORR5N3hhQAaBcEsyOZmi6ACfXMrx HUvaShUKZFwX385E0A1dq98= =3Rfo -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - 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: context.xml locations and servlet mappings
One META-INF/context.xml per Context is the intended usage. The appBase ../your/app/base should contain: .../app/base/ROOT/index.jsp .../app/base/ROOT/WEB-INF/web.xml .../app/base/ROOT/META-INF/context.xml .../app/base/Other/index.jsp .../app/base/Other/WEB-INF/web.xml .../app/base/Other/META-INF/context.xml for /index.jsp and /Other/index.jsp, where ROOT is the location for the default Context. p Angelov, Rossen wrote: Chris, This didn't help. Removing them is not generating errors, the servlet still loads on startup, but then the mapping don't work. It doesn't make sense to remove the path and the docBase. Especially the docBase, it specifies the Context Root. If it's empty, it probably uses the host appBase for root, but this is incorrect. I should be able to specify the context root. What about the cases when there are more than one contexts per host? The problem seems to be somewhere else, but thanks for the advise. Ross -Original Message- From: Christopher Schultz [mailto:[EMAIL PROTECTED] Sent: Monday, June 04, 2007 4:46 PM To: Tomcat Users List Subject: Re: context.xml locations and servlet mappings -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ross, Angelov, Rossen wrote: META-INF/context.xml Context path= docBase=html debug=0 privileged=true Take out the path and docBase parameters. They are either illegal or ill-advised when using META-INF/context.xml. This might not be /the/ problem, but you should definitely remove those two attributes. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGZIgZ9CaO5/Lv0PARAoQoAKCIs1myORR5N3hhQAaBcEsyOZmi6ACfXMrx HUvaShUKZFwX385E0A1dq98= =3Rfo -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] smime.p7s Description: S/MIME Cryptographic Signature
RE: context.xml locations and servlet mappings
Thank you for explaining about the META-INF location. Mine is following exactly the same pattern as you described, but still the servlet mappings are not functioning when using the META-INF/context.xml. Do you have any clues why this could be happening? The mappings work fine when inside the host element in server.xml. Ross -Original Message- From: Pid [mailto:[EMAIL PROTECTED] Sent: Monday, June 04, 2007 5:25 PM To: Tomcat Users List Subject: Re: context.xml locations and servlet mappings One META-INF/context.xml per Context is the intended usage. The appBase ../your/app/base should contain: .../app/base/ROOT/index.jsp .../app/base/ROOT/WEB-INF/web.xml .../app/base/ROOT/META-INF/context.xml .../app/base/Other/index.jsp .../app/base/Other/WEB-INF/web.xml .../app/base/Other/META-INF/context.xml for /index.jsp and /Other/index.jsp, where ROOT is the location for the default Context. p Angelov, Rossen wrote: Chris, This didn't help. Removing them is not generating errors, the servlet still loads on startup, but then the mapping don't work. It doesn't make sense to remove the path and the docBase. Especially the docBase, it specifies the Context Root. If it's empty, it probably uses the host appBase for root, but this is incorrect. I should be able to specify the context root. What about the cases when there are more than one contexts per host? The problem seems to be somewhere else, but thanks for the advise. Ross -Original Message- From: Christopher Schultz [mailto:[EMAIL PROTECTED] Sent: Monday, June 04, 2007 4:46 PM To: Tomcat Users List Subject: Re: context.xml locations and servlet mappings -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ross, Angelov, Rossen wrote: META-INF/context.xml Context path= docBase=html debug=0 privileged=true Take out the path and docBase parameters. They are either illegal or ill-advised when using META-INF/context.xml. This might not be /the/ problem, but you should definitely remove those two attributes. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGZIgZ9CaO5/Lv0PARAoQoAKCIs1myORR5N3hhQAaBcEsyOZmi6ACfXMrx HUvaShUKZFwX385E0A1dq98= =3Rfo -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - 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: context.xml locations and servlet mappings
Angelov, Rossen wrote: Thank you for explaining about the META-INF location. Mine is following exactly the same pattern as you described, but still the servlet mappings are not functioning when using the META-INF/context.xml. When you define a Context inside the Host, the path attribute is permitted. When you define a Context elsewhere the path attribute is not permitted, (as Chris explained), but the path is defined by the directory name, or the .war file name. ROOT is a special name for the default context, it's upper case and is the means used to define the default context. You can't define the default context using another name if you're using the recommended method of deploying a context. Hence my example below. p (p.s. just reply to the group, not me as well.) Do you have any clues why this could be happening? The mappings work fine when inside the host element in server.xml. Ross -Original Message- From: Pid [mailto:[EMAIL PROTECTED] Sent: Monday, June 04, 2007 5:25 PM To: Tomcat Users List Subject: Re: context.xml locations and servlet mappings One META-INF/context.xml per Context is the intended usage. The appBase ../your/app/base should contain: .../app/base/ROOT/index.jsp .../app/base/ROOT/WEB-INF/web.xml .../app/base/ROOT/META-INF/context.xml .../app/base/Other/index.jsp .../app/base/Other/WEB-INF/web.xml .../app/base/Other/META-INF/context.xml for /index.jsp and /Other/index.jsp, where ROOT is the location for the default Context. p Angelov, Rossen wrote: Chris, This didn't help. Removing them is not generating errors, the servlet still loads on startup, but then the mapping don't work. It doesn't make sense to remove the path and the docBase. Especially the docBase, it specifies the Context Root. If it's empty, it probably uses the host appBase for root, but this is incorrect. I should be able to specify the context root. What about the cases when there are more than one contexts per host? The problem seems to be somewhere else, but thanks for the advise. Ross -Original Message- From: Christopher Schultz [mailto:[EMAIL PROTECTED] Sent: Monday, June 04, 2007 4:46 PM To: Tomcat Users List Subject: Re: context.xml locations and servlet mappings -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ross, Angelov, Rossen wrote: META-INF/context.xml Context path= docBase=html debug=0 privileged=true Take out the path and docBase parameters. They are either illegal or ill-advised when using META-INF/context.xml. This might not be /the/ problem, but you should definitely remove those two attributes. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGZIgZ9CaO5/Lv0PARAoQoAKCIs1myORR5N3hhQAaBcEsyOZmi6ACfXMrx HUvaShUKZFwX385E0A1dq98= =3Rfo -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] smime.p7s Description: S/MIME Cryptographic Signature
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]
Servlet Mappings
Hi I am having some trouble with setting up my servlet mappings. I am replacing a legacy webapp but need to keep the same urls. The current webapp uses cocoon. Here is my web.xml web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 display-nameWebapp/display-name !-- - Location of the Log4J config file, for initialization and refresh checks. - Applied by Log4jConfigListener. -- context-param param-namelog4jConfigLocation/param-name param-value/WEB-INF/log4j.properties/param-value /context-param listener listener-classorg.springframework.web.util.Log4jConfigListener/listener-class /listener context-param param-namecontextConfigLocation/param-name param-value /WEB-INF/formats.xml /WEB-INF/controllers.xml /WEB-INF/conf/global_conf.xml /WEB-INF/conf/customer1_conf.xml /param-value /context-param listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener servlet servlet-nametest/servlet-name servlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet servlet-nametesterror/servlet-name servlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nametesterror/servlet-name url-pattern/error/*/url-pattern /servlet-mapping servlet-mapping servlet-nametest/servlet-name url-pattern//url-pattern /servlet-mapping servlet-mapping servlet-namedefault/servlet-name url-pattern/images/url-pattern /servlet-mapping servlet-mapping servlet-namedefault/servlet-name url-pattern/css/url-pattern /servlet-mapping servlet-mapping servlet-namedefault/servlet-name url-pattern/js/url-pattern /servlet-mapping /web-app With this setup requests that start with /error go to the testerror servlet, all other requests go to the test servlet. Can anyone give me some pointers? Ben - 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]