Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

Re: [OT] Servlet Filtering & performance..

prt

2007-03-06

Replies:


Hi,
My list is small only 5 URLS,
I save it in (String[]), that load in the Filter init method by init
parameter in the web.xml.
Every request i take the ServletPath and to this part in function,

boolean bRunURL;

for(int i = 0, max = sArrAlowd.length; i < max && !bRunURL; i++)
  bRunURL = (sServletPath.indexOf(sArrAlowd[i],1) == 1);

return bRunURL;

U think is ok ?


Tim Funk wrote:
>
> If your allowed list check is small and simple (and NOT synchronized) -
> the performance impact is probably not noticeable.
>
> If your list of URLS is large - then your check would be based on your
> check algorithm. (http://en.wikipedia.org/wiki/Big_O_notation)
>
> -Tim
>
> prt wrote:
>> Hi to all again,
>>
>> I added filter object for all requests <url-pattern>/*</url-pattern>.
>> In the Filter class i check the ServletPath
>> (HttpServletRequest.getServletPath()) and
>> i check if is equals to alist of allowd paths. it is work just perfect.
>> But i think that is damage the performance, is it ?
>>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@(protected)
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>
>

--
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.