Bug 42025 - Incorrect documentation in RemoteAddrValve/RemoteHostValve
Incorrect documentation in RemoteAddrValve/RemoteHostValve
Product: Tomcat 5
Classification: Unclassified
Component: Webapps:Documentation
Other other
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
Depends on:
  Show dependency tree
Reported: 2007-04-02 16:22 UTC by Renaud Waldura
Modified: 2007-04-15 12:47 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Renaud Waldura 2007-04-02 16:22:49 UTC
The documentation page at http://tomcat.apache.org/tomcat-5.5-
doc/config/valve.html says:

"The syntax for regular expressions is different than that for 'standard' 
wildcard matching. Tomcat uses the Jakarta Regexp library. Please consult the 
Regexp documentation for details of the expressions supported."

This is incorrect. In reality, the standard Java regexp package java.util.regex 
is used. The syntax is slightly different than Jakarta Regexp. In particular, 
the matches() method is used by RemoteAddrValve/RemoteHostValve, which attempts 
to match the entire region against the pattern. 

E.g. I expected
<Valve allow="^127\." ...
to match localhost addresses. But this doesn't work, I must write 
<Valve allow="127\.0\.0\.\d" ...
because the *entire* region is matched with java.util.regex. (Note the lack of 

(While I'm reporting this as a documentation issue, it could also be viewed as 
a feature regression since region matches were previously supported, as far as 
I can tell.)

NOTE: I'm logging this problem against 5.5, but it also exists in the 6.0 
Comment 1 Mark Thomas 2007-04-15 12:47:13 UTC
Fixed in svn and will be included in 5.5.24 and 6.0.12.

Thanks for the report.