You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Craig R. McClanahan" <Cr...@eng.sun.com> on 2000/09/19 02:27:02 UTC
Re: HOWTO Question: Extra arguments in the URL of a GET request
available to servlet via request.getPathInfo()
"Desaulniers, Peter" wrote:
> Thanks Craig, that worked.
>
> Being limited to start.py is acceptable since the extension mapping will
> always be on that one module.
>
> So /start.py/* worked. Can you explain why that works? I am curious about:
>
> 1. The leading slash
> 2. A fixed term for the extension mapping (e.g start.py vs *.py)
> 3. Only one wild card in the expression
>
> I had tried a number of patterns, but not that specific one. None of which
> did what I needed. It would be very useful to understand a little theory
> behind why that pattern works, if you have time to explain.
>
The rules that Tomcat (and every other 2.2-compliant servlet container) uses are
outlined in the Servlet API Specification, version 2.2, that can be downloaded
from <http://java.sun.com/products/servlet/download.html>. Check out chapter
10. The relevant stuff is only a couple of pages long.
The leading slash, by the way, is because the pattern you specify is relative to
the context path of the current webapp. That way, the server administrator
could change the context path to which they attached your app (the "/mycgi"
part) and your application would still work correctly.
>
> Thanks again.
>
> -- Peter Desaulniers
>
> "Give a man a fish, you feed him for a day. Teach a man to fish, you feed
> him for life." (some wise person)
>
Consider the hyperlink to the servlet spec above to be your fishing pole :-).
Craig
====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00): Sun Technical Briefing
Session T06 (24-Oct 14h00-15h00): Migrating Apache JServ
Applications to Tomcat