Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 713E3102C8 for ; Tue, 17 Sep 2013 20:08:32 +0000 (UTC) Received: (qmail 66718 invoked by uid 500); 17 Sep 2013 20:08:02 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 66610 invoked by uid 500); 17 Sep 2013 20:07:58 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 66377 invoked by uid 99); 17 Sep 2013 20:07:54 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Sep 2013 20:07:54 +0000 Date: Tue, 17 Sep 2013 20:07:54 +0000 (UTC) From: "Hudson (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-4199) Exclusion of URLs should be done before calling prepare. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13769868#comment-13769868 ] Hudson commented on WW-4199: ---------------------------- SUCCESS: Integrated in Struts2-JDK6 #800 (See [https://builds.apache.org/job/Struts2-JDK6/800/]) WW-4199 Exclusion of URLs should be done before calling prepare. (jogep: rev 1524186) * /struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareAndExecuteFilter.java * /struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.java > 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.16 > > > I have some webservices under /services in my webapp, and I have excluded them from Struts by using the excludePattern filter: > {code:xml} > struts.action.excludePattern > /services/.* > {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} > #### <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1379111934567> <[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