From: Marc P. <ma...@an...> - 2003-03-22 13:17:44
|
On Fri, 21 Mar 2003 15:24:18 -0500, <kea...@na...> wrote: > Marc, > > I don't have a clear picture of what exactly you want or what the problem > is, but there are various ways to get the different parts of the Request > URL. For instance, > > HttpServletRequest.getRequestURI(): [snip] > or HttpUtil.getRequestURL(): Hehe, thanks for that Keats. Indeed they would make it possible but I'm trying to find a simple way that uses existing mechanisms rather than writing a whole bunch of parsing code to do it. The problem I was trying to get across is the different treatment that servlets get with respect to getPathInfo and getServletPath when you are using a servlet-mapping that is for file types rather than for a URI. It's very annoying. IMO getPathInfo should return the filename part of the URI (everything after context path) when a servlet is called for a file type servlet-mapping request. This would make it consistent with getPathInfo when using a URI servlet-mapping. That way you could just check if getServletPath() returns null and if so it means you've been called from a file type mapping, and if the servlet path is non-null it means it was a URI mapping. This is what I'm seeing with Tomcat 4 anyway. It's horrible. > By default templates can be loaded from the Webapp context root. This > could > be a security concern in some environments, as you've indicated, which is > why there are various ways to configure this. > > Probably the best way, imho, is to use the delegating template provider > to > restrict templates to a special template directory under WEB-INF. That sounds like a good idea. I need to catch up with the new Delegating template provider stuff. Thanks Marc -- Marc Palmer |