Hi all. I noticed excludePattern doesn't work as expected in 2.1.8-SNAPSHOT. The problem is prepare.wrapRequest(request), it's called whether or not isUrlExcluded() which is not what we want. The whole point of setting the struts.action.excludePattern property is to tell Struts2 to "lay off" the matching URLs.
The thing for me is that I have Struts2 in the same webapp as other stuff, Struts-1.1 being one of them, and I *need* the multipart-request to reach the Struts-1.1 actions which resides in an URL which matches the excludePattern. Attached is a patch fixing it, hopefully this will make it in the 2.1.8-GA. -- Andreas Joseph Krogh <andr...@officenet.no> Senior Software Developer / CTO ------------------------+---------------------------------------------+ OfficeNet AS | The most difficult thing in the world is to | Rosenholmveien 25 | know how to do a thing and to watch | 1414 TrollÄsen | somebody else doing it wrong, without | NORWAY | comment. | | | Tlf: +47 24 15 38 90 | | Fax: +47 24 15 38 91 | | Mobile: +47 909 56 963 | | ------------------------+---------------------------------------------+
Index: core/src/main/java/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareAndExecuteFilter.java =================================================================== --- core/src/main/java/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareAndExecuteFilter.java (revision 806086) +++ core/src/main/java/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareAndExecuteFilter.java (working copy) @@ -77,10 +77,10 @@ prepare.setEncodingAndLocale(request, response); prepare.createActionContext(request, response); prepare.assignDispatcherToThread(); - request = prepare.wrapRequest(request); if ( excludedPatterns != null && prepare.isUrlExcluded(request, excludedPatterns)) { chain.doFilter(request, response); } else { + request = prepare.wrapRequest(request); ActionMapping mapping = prepare.findActionMapping(request, response, true); if (mapping == null) { boolean handled = execute.executeStaticResourceRequest(request, response); Index: core/src/main/java/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.java =================================================================== --- core/src/main/java/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.java (revision 806086) +++ core/src/main/java/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.java (working copy) @@ -73,10 +73,10 @@ prepare.setEncodingAndLocale(request, response); prepare.createActionContext(request, response); prepare.assignDispatcherToThread(); - request = prepare.wrapRequest(request); if ( excludedPatterns != null && prepare.isUrlExcluded(request, excludedPatterns)) { request.setAttribute(REQUEST_EXCLUDED_FROM_ACTION_MAPPING, new Object()); } else { + request = prepare.wrapRequest(request); prepare.findActionMapping(request, response); } chain.doFilter(request, response);
--------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@struts.apache.org For additional commands, e-mail: dev-h...@struts.apache.org