tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
Subject Re: <url-pattern>/*.jsp</url-pattern>
Date Thu, 07 Oct 2004 13:24:58 GMT
In that case look at ErrorFilter from my Servlet Utilities. It allows you to 
set an error based on an EL expression. (The utilities depend on tomcat 5).

For example - to block all direct jsp access.

<filter>
   <filter-name>ErrorFilter</filter-name>
   <filter-class>net.funkman.servletutil.filter.ErrorFilter</filter-class>
     <init-param>
       <param-name>errorCode</param-name>
       <param-value>403</param-value>
     </init-param>
   <init-param>
     <param-name>condition</param-name>
     <param-value>
        ${match('/.jsp$/', request.servletPath)}
     </param-value>
   </init-param>
</filter>

http://funkman.home.comcast.net/servletutils-0.2/


But a better way to block direct jsp access is to move the JSP files under a 
WEB-INF (or a subdirectory in WEB-INF)

-Tim

Fred Blaise wrote:

> Well, I am developping a site I would like to block entry to.
> However, my .css file is also in this directory, so having a pattern of /* also
> blocks access to my css, making the site very ugly to see.
> 
> I have tried the following, with no result:
> .jsp (no result), jsp (no result), *.jsp (app fails to start)
> 
> I haven't tried such thing such as regex.. I haven't seen that anywhere... Woudl
> something like /\.jsp$\ work?
> 
> Thanks
> 
> Fred
> 
> Quoting Peter Johnson <peter@wizardslair.net>:
> 
> 
>><url-pattern>*.jsp</url-pattern>
>>
>>But I think that you'll find that this is defined in the core web.xml to
>>go to the JSP servlet.
>>
>>What are you trying to achieve?
>>
>>
>>On Thu, 2004-10-07 at 15:22, Fred Blaise wrote:
>>
>>>any possible way i can achieve this in my web.xml ? Bc it wont the app
>>>won't start with this... (tomcat 5.0.28)
>>>
>>><url-pattern>/*.jsp</url-pattern>
>>>
>>>thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message