Bug 42025 - Incorrect documentation in RemoteAddrValve/RemoteHostValve
Summary: Incorrect documentation in RemoteAddrValve/RemoteHostValve
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Webapps:Documentation (show other bugs)
Version: 5.5.23
Hardware: Other other
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-02 16:22 UTC by Renaud Waldura
Modified: 2007-04-15 12:47 UTC (History)
0 users



Attachments

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 
anchor.)

(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 
documentation.
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.