Re: Servlet mapping question -- way to include everythign EXCEPT a directory?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, On 7/1/2010 12:31 PM, Caldarale, Charles R wrote: From: laredotornado [mailto:laredotorn...@gmail.com] Subject: RE: Servlet mapping question -- way to include everythign EXCEPT a directory? I like your idea about specifying the DefaultServlet, but what do you mean by the DefaultServlet ? Tomcat's built-in servlet that handles all static content. It's defined in the global conf/web.xml, and thus included in all deployed webapps: [snip] servlet-mapping servlet-namedefault/servlet-name url-pattern/play/sports/includes/*/url-pattern servlet-mapping Just a note to Dave: using this mapping might couple your webapp to Tomcat by relying on a global-mapping with a servlet called default. I don't think that's in the spec, so you might want to put a comment in your web.xml pointing out that the mapping might be Tomcat-specific. You'll save yourself (or someone else) a lot of headache in the future with that simple comment. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkwv8iQACgkQ9CaO5/Lv0PAZbACfYXCGM/cybZnFAanvjr3eMhVl WeEAn3Q3z12dsOd5N3IqJTCU9hs+QTyP =8CwB -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Servlet mapping question -- way to include everythign EXCEPT a directory?
From: laredotornado [mailto:laredotorn...@gmail.com] Subject: Servlet mapping question -- way to include everythign EXCEPT a directory? I don't know how to specify not in a mapping That's because you can't specify a not. What you can do is specify what should handle /play/sports/includes/* - such as the DefaultServlet or perhaps some error handler. The servlet spec requires that the container match against the longest pattern first, so the more specific will override the more general. - 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 mapping question -- way to include everythign EXCEPT a directory?
I like your idea about specifying the DefaultServlet, but what do you mean by the DefaultServlet ? - Dave n828cl wrote: From: laredotornado [mailto:laredotorn...@gmail.com] Subject: Servlet mapping question -- way to include everythign EXCEPT a directory? I don't know how to specify not in a mapping That's because you can't specify a not. What you can do is specify what should handle /play/sports/includes/* - such as the DefaultServlet or perhaps some error handler. The servlet spec requires that the container match against the longest pattern first, so the more specific will override the more general. - 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 -- View this message in context: http://old.nabble.com/Servlet-mapping-questionway-to-include-everythign-EXCEPT-a-directory--tp29046779p29047783.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Servlet mapping question -- way to include everythign EXCEPT a directory?
On Thu, Jul 1, 2010 at 9:24 AM, laredotornado laredotorn...@gmail.com wrote: I like your idea about specifying the DefaultServlet, but what do you mean by the DefaultServlet ? - Dave http://www.google.com/search?q=tomcat+DefaultServlet -- Hassan Schroeder hassan.schroe...@gmail.com twitter: @hassan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Servlet mapping question -- way to include everythign EXCEPT a directory?
From: laredotornado [mailto:laredotorn...@gmail.com] Subject: RE: Servlet mapping question -- way to include everythign EXCEPT a directory? I like your idea about specifying the DefaultServlet, but what do you mean by the DefaultServlet ? Tomcat's built-in servlet that handles all static content. It's defined in the global conf/web.xml, and thus included in all deployed webapps: servlet servlet-namedefault/servlet-name servlet-classorg.apache.catalina.servlets.DefaultServlet/servlet-class ...snip... /servlet It has this mapping: servlet-mapping servlet-namedefault/servlet-name url-pattern//url-pattern /servlet-mapping so it gets to process anything that doesn't match any other mapping. Just add this to your webapp's WEB-INF/web.xml: servlet-mapping servlet-namedefault/servlet-name url-pattern/play/sports/includes/*/url-pattern servlet-mapping - 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 mapping question -- way to include everythign EXCEPT a directory?
Caldarale, Charles R wrote: From: laredotornado [mailto:laredotorn...@gmail.com] Subject: RE: Servlet mapping question -- way to include everythign EXCEPT a directory? I like your idea about specifying the DefaultServlet, but what do you mean by the DefaultServlet ? Tomcat's built-in servlet that handles all static content. It's defined in the global conf/web.xml, and thus included in all deployed webapps: servlet servlet-namedefault/servlet-name servlet-classorg.apache.catalina.servlets.DefaultServlet/servlet-class ...snip... /servlet It has this mapping: servlet-mapping servlet-namedefault/servlet-name url-pattern//url-pattern /servlet-mapping so it gets to process anything that doesn't match any other mapping. Just add this to your webapp's WEB-INF/web.xml: servlet-mapping servlet-namedefault/servlet-name url-pattern/play/sports/includes/*/url-pattern servlet-mapping - Chuck If it isn't yet the case, this might be worth a short Wiki article, including the short explanation above. While it is true that this can be derived from the page at http://tomcat.apache.org/tomcat-6.0-doc/default-servlet.html I still believe it is not so evident for a beginner. That page gives a complicated example to do with listings, but the OP's question is in fact a fairly basic and recurrent one. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: servlet mapping question(I believe)
Terence Kent wrote: Conclusion: My understanding from this configuration is that all requests on port 8010, that end with the extension .ext should be forwarded to the servlet mycompany. From what I've read, any paths created in the ${APP_BASE} directory should be irrelevant in this mapping and all logic comes from the web.xml file. My understanding appears to be wrong and I would greatly appreciate being pointed in the right direction. You can't set appBase == docBase. The following should do what you want: rename /opt/path/to/webapps/page to /opt/path/to/webapps/ROOT use appBase=/opt/path/to/webapps use docBase=ROOT Also, I wouldn't configure the context in server.xml. See http://tomcat.apache.org/tomcat-6.0-doc/config/context.html for other options. HTH, Mark - 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-mapping question
From: news [mailto:[EMAIL PROTECTED] On Behalf Of hv @ Fashion Content Subject: servlet-mapping question Should catch all of the following if I am not mistaken, not just some of them right? http://www.domain.com/ZoA+xaeoHh6s,$EnterPromotionCode.$Form.topic http://www.domain.com/ZoA+xaeoHh6s,$EnterPromotionCode-$Form.topic http://www.domain.com/ZoA+xaeoHh6s*Extra,$EnterPromotionCode.$Form.topic http://www.domain.com/ZoA+xaeoHh6s*Extra,$EnterPromotionCode.$Form.topic http://www.domain.com/ZoA+xaeoHh6s.Extra,$EnterPromotionCode.$Form.topic Don't know if this is actually part of the problem, but you might want to look at RFC 3986, especially pages 11 and 12. Some of the above characters are not legal in a URI and must be escaped. I have no idea what Tomcat does with invalid URIs. - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: servlet-mapping question
Good point, but I am not trying to adhere strictly to the URI rfc, as it is generated by the server to refer to the server. Caldarale, Charles R [EMAIL PROTECTED] skrev i en meddelelse news:[EMAIL PROTECTED] From: news [mailto:[EMAIL PROTECTED] On Behalf Of hv @ Fashion Content Subject: servlet-mapping question Should catch all of the following if I am not mistaken, not just some of them right? http://www.domain.com/ZoA+xaeoHh6s,$EnterPromotionCode.$Form.topic http://www.domain.com/ZoA+xaeoHh6s,$EnterPromotionCode-$Form.topic http://www.domain.com/ZoA+xaeoHh6s*Extra,$EnterPromotionCode.$Form.topic http://www.domain.com/ZoA+xaeoHh6s*Extra,$EnterPromotionCode.$Form.topic http://www.domain.com/ZoA+xaeoHh6s.Extra,$EnterPromotionCode.$Form.topic Don't know if this is actually part of the problem, but you might want to look at RFC 3986, especially pages 11 and 12. Some of the above characters are not legal in a URI and must be escaped. I have no idea what Tomcat does with invalid URIs. - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: servlet-mapping question
From: news [mailto:[EMAIL PROTECTED] On Behalf Of hv @ Fashion Content Subject: servlet-mapping question Good point, but I am not trying to adhere strictly to the URI rfc, as it is generated by the server to refer to the server. I don't think it matters who or what generates the URI. If it doesn't follow the syntax rules, it's probably going to confuse the servlet mapping scanner. (Admittedly, I haven't looked at that specific code in Tomcat, but I would certainly expect it to match against the servlet mapping by parsing the URI based on the RFC. The presence of delimiters in a URI may well stop the scan.) - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]