tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis GALIEGUE <...@one2team.com>
Subject Re: Denying IPs using the Valve command in context.xml
Date Tue, 04 Oct 2011 20:58:37 GMT
On Tue, Oct 4, 2011 at 22:50, André Warnier <aw@ice-sa.com> wrote:
[...]
>
> So my question is : which of Matcher or Pattern is really used in the
> Valve's code ?
>

You use a Matcher to match. A Pattern is only the compiled form of a regex:

final String re = "^";
final Pattern p = Pattern.compile(re);
final Matcher m = p.matcher("myinput");

if (m.matches())
    // etc

So, the fact that Matcher instances are not thread safe is not really
the problem.

[...]
>
> - or the documentation should be amended to indicate that the expression
> provided for allow and deny is already automatically anchored at the
> beginning and end of the string.

Agreed. The Tomcat documentation also suffered the same problem (wrt
regex usage in its <regex-mapper> IIRC) and I've had the doc fixed :p

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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


Mime
View raw message