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 DEF4EE606 for ; Thu, 3 Jan 2013 22:40:13 +0000 (UTC) Received: (qmail 55225 invoked by uid 500); 3 Jan 2013 22:40:13 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 55182 invoked by uid 500); 3 Jan 2013 22:40:13 -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 55017 invoked by uid 99); 3 Jan 2013 22:40:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jan 2013 22:40:13 +0000 Date: Thu, 3 Jan 2013 22:40:13 +0000 (UTC) From: =?utf-8?Q?Horv=C3=A1th=2C_=C3=81kos_P=C3=A9ter_=28JIRA=29?= To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (WW-3956) silent failure of filter initialization if struts.action.excludePattern contains invalid regexp MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-3956?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:all-tabpanel ] Horv=C3=A1th, =C3=81kos P=C3=A9ter updated WW-3956: ------------------------------------ Description:=20 If the struts.action.excludePatterns constant contains an invalid regexp (f= or example, it begins with a "*"), the dispatcher can't initialize, but onl= y an "Error filterStart" message will be logged, and the web app won't work= . Imho, the expected behavior were a stack trace or a more descriptive erro= r message. The cause of the problem: the buildExcludedPatternList() method of org.apac= he.struts2.dispatcher.ng.InitOperations builds a compiled pattern list of t= he comma-separated patterns given in this constant with java.util.regex.Pat= tern.compile() . This emits an IllegalArgumentException or a PatternSyntaxE= xception, if invalid regexp is given, but this exception somewhere silently= disappears on his way to the log. --------------- I suggest to make a minimal example in the documentation: .*\.(css|js|gif|png|jpg|html)$ is what most developer wants from this constant. For me take hours to inves= tigate this. Googling for "struts.action.excludePattern" reveals a lot of c= onfusion about this, too. The greatest source of the confusion is that it i= sn't clear, and isn't anywhere documented, which is the exact regexp syntax= here to apply. For example: pattern matching or regular expression, "^" an= d "$" are valid or not, they are needed or not, "." matches only "." or any= character, etc. I think, the original inaccuracy was committed by sun, whe= n they named a class as "Pattern", which operates with regexps. What you he= re can do, is a single-line minimal-example in the doc, which will explain = everything. Thank you, PH was: If the struts.action.excludePatterns constant contains an invalid regexp (f= or example, it begins with a "*"), the dispatcher can't initialize, but onl= y an "Error filterStart" message will be logged, and the web app won't work= . Imho, the expected behavior were a stack trace or a more descriptive erro= r message. The cause of the problem: the buildExcludedPatternList() method of org.apac= he.struts2.dispatcher.ng.InitOperations.java builds a compiled pattern list= of the comma-separated patterns given in this constant with java.util.rege= x.Pattern.compile() . This emits an IllegalArgumentException or a PatternSy= ntaxException, if invalid regexp is given, but this exception somewhere sil= ently disappears on his way to the log. --------------- I suggest to make a minimal example in the documentation: .*\.(css|js|gif|png|jpg|html)$ is what most developer wants from this constant. For me take hours to inves= tigate this. Googling for "struts.action.excludePattern" reveals a lot of c= onfusion about this, too. The greatest source of the confusion is that it i= sn't clear, and isn't anywhere documented, which is the exact regexp syntax= here to apply. For example: pattern matching or regular expression, "^" an= d "$" are valid or not, they are needed or not, "." matches only "." or any= character, etc. I think, the original inaccuracy was committed by sun, whe= n they named a class as "Pattern", which operates with regexps. What you he= re can do, is a single-line minimal-example in the doc, which will explain = everything. Thank you, PH =20 > silent failure of filter initialization if struts.action.excludePattern c= ontains invalid regexp > -------------------------------------------------------------------------= ---------------------- > > Key: WW-3956 > URL: https://issues.apache.org/jira/browse/WW-3956 > Project: Struts 2 > Issue Type: Bug > Components: Dispatch Filter > Affects Versions: 2.3.8 > Environment: all > Reporter: Horv=C3=A1th, =C3=81kos P=C3=A9ter > Original Estimate: 1h > Remaining Estimate: 1h > > If the struts.action.excludePatterns constant contains an invalid regexp = (for example, it begins with a "*"), the dispatcher can't initialize, but o= nly an "Error filterStart" message will be logged, and the web app won't wo= rk. Imho, the expected behavior were a stack trace or a more descriptive er= ror message. > The cause of the problem: the buildExcludedPatternList() method of org.ap= ache.struts2.dispatcher.ng.InitOperations builds a compiled pattern list of= the comma-separated patterns given in this constant with java.util.regex.P= attern.compile() . This emits an IllegalArgumentException or a PatternSynta= xException, if invalid regexp is given, but this exception somewhere silent= ly disappears on his way to the log. > --------------- > I suggest to make a minimal example in the documentation: > .*\.(css|js|gif|png|jpg|html)$ > is what most developer wants from this constant. For me take hours to inv= estigate this. Googling for "struts.action.excludePattern" reveals a lot of= confusion about this, too. The greatest source of the confusion is that it= isn't clear, and isn't anywhere documented, which is the exact regexp synt= ax here to apply. For example: pattern matching or regular expression, "^" = and "$" are valid or not, they are needed or not, "." matches only "." or a= ny character, etc. I think, the original inaccuracy was committed by sun, w= hen they named a class as "Pattern", which operates with regexps. What you = here can do, is a single-line minimal-example in the doc, which will explai= n everything. > Thank you, > PH -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira