This is an automated email from the ASF dual-hosted git repository.
lukaszlenart pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/struts-site.git
The following commit(s) were added to refs/heads/main by this push:
new b19aba056c docs: describe what struts.action.excludePattern is matched
against (#380)
b19aba056c is described below
commit b19aba056c117f50f731a5321a0e2d4a69942522
Author: Lukasz Lenart <[email protected]>
AuthorDate: Fri Nov 20 13:07:10 2026 +0100
docs: describe what struts.action.excludePattern is matched against (#380)
The page said the patterns are evaluated against getRequestURI(). They are
matched in full against the servlet path plus path info, without the context
path. Also state that a pattern excludes paths rather than actions.
Co-authored-by: Claude Mythos 5.2 <[email protected]>
---
source/core-developers/static-content.md | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/source/core-developers/static-content.md
b/source/core-developers/static-content.md
index 5ae76d0c79..b537b49775 100644
--- a/source/core-developers/static-content.md
+++ b/source/core-developers/static-content.md
@@ -144,8 +144,14 @@ you can do so by specifying a comma separated list of
regular expressions like:
<constant name="struts.action.excludePattern"
value="/some/content/.*,/other/content/.*"/>
```
-These regular expression will be evaluated against the request's URI
(`HttpServletRequest.getRequestURI()`), and if any
-of them matches, then Struts will not handle the request.
+These regular expressions are evaluated against the request path inside the
application: the servlet path followed by
+the path info, without the context path and without the query string. A
pattern has to match the whole path. If any of
+them matches, Struts does not handle the request and passes it on to the next
filter in the chain.
+
+A pattern excludes paths, not actions. The same action can answer on more than
one path, for example through the
+default namespace (see [Namespace Configuration](namespace-configuration)) or
through each extension listed in
+`struts.action.extension` (see [ActionMapper](action-mapper)), so an exclusion
is not a way to restrict access to
+an action. To make an action unreachable, remove its mapping. To restrict it,
apply authorization to the action itself.
To evaluate each pattern the `Pattern` class from JDK will be used, you can
find more about what kind of pattern you can
use in the [Pattern class
JavaDoc](http://docs.oracle.com/javase/1.5.0/docs/api/java/util/regex/Pattern).