[
https://issues.apache.org/jira/browse/WW-4199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13769838#comment-13769838
]
ASF subversion and git services commented on WW-4199:
-----------------------------------------------------
Commit 1524186 from [~jogep] in branch 'struts2/trunk'
[ https://svn.apache.org/r1524186 ]
WW-4199 Exclusion of URLs should be done before calling prepare.
> Exclusion of URLs should be done before calling prepare.
> --------------------------------------------------------
>
> Key: WW-4199
> URL: https://issues.apache.org/jira/browse/WW-4199
> Project: Struts 2
> Issue Type: Bug
> Components: Dispatch Filter
> Reporter: Jose L Martinez-Avial
> Assignee: Johannes Geppert
> Priority: Minor
> Fix For: 2.3.17
>
>
> I have some webservices under /services in my webapp, and I have excluded
> them from Struts by using the excludePattern filter:
> {code:xml}
> <param-name>struts.action.excludePattern</param-name>
> <param-value>/services/.*</param-value>
> {code}
> The problem is that the classes StrutsPrepareAndExecuteFilter and
> StrutsPrepareFilter do some calls before to prepare before checking if the
> URL should be treated. In the case of the webservices it provokes the
> following exception:
> {noformat}
> ####<Sep 13, 2013 6:38:54 PM EDT> <Error> <HTTP> <naboo.mia.usa.sinvest>
> <EcoPrdInt> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default
> (self-tuning)'> <<anonymous>> <> <> <1379111934567> <BEA-101108>
> <[weblogic.servlet.internal.WebAppServletContext@2f97ff - appName:
> 'test-int', name: 'test-int.war', context-path: '/test-int', spec-version:
> '2.5'] Unsupported encoding: "UTF-8;
> action="urn:publishDocumentForSignature"" specified.
> java.io.UnsupportedEncodingException: Unsupported Encoding UTF-8;
> action="urn:publishDocumentForSignature"
> at
> weblogic.servlet.internal.ServletRequestImpl.setCharacterEncoding(ServletRequestImpl.java:428)
> at
> weblogic.servlet.internal.ServletRequestImpl.initRequestEncoding(ServletRequestImpl.java:1115)
> at
> weblogic.servlet.internal.ServletRequestImpl.getCharacterEncoding(ServletRequestImpl.java:451)
> at
> org.apache.struts2.dispatcher.Dispatcher.applyEncoding(Dispatcher.java:762)
> at
> org.apache.struts2.dispatcher.Dispatcher.prepare(Dispatcher.java:748)
> at
> org.apache.struts2.dispatcher.ng.PrepareOperations.setEncodingAndLocale(PrepareOperations.java:121)
> at
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:85)
> {noformat}
> And that's due to the filter calling prepare to set the encoding and locale
> in the following code in StrutsPrepareAndExecuteFilter:
> {code:java}
> [...]
> try {
> prepare.setEncodingAndLocale(request, response);
> prepare.createActionContext(request, response);
> prepare.assignDispatcherToThread();
> if (excludedPatterns != null && prepare.isUrlExcluded(request,
> excludedPatterns)) {
> chain.doFilter(request, response);
> } else {
> [...]
> {code}
> But if the URL is going to be excluded, why is it doing that call? I think
> the calls to prepare should be done after checking the URL for exclusions.
> Unless I'm missing something, it shouldn't impact anything, right?
> Thanks
> JL
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira