Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 72721 invoked from network); 5 May 2009 14:34:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 May 2009 14:34:40 -0000 Received: (qmail 2915 invoked by uid 500); 5 May 2009 14:34:36 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 2845 invoked by uid 500); 5 May 2009 14:34:36 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 2835 invoked by uid 99); 5 May 2009 14:34:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2009 14:34:36 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of pierre.henry@unine.ch designates 130.125.1.53 as permitted sender) Received: from [130.125.1.53] (HELO columba.unine.ch) (130.125.1.53) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2009 14:34:26 +0000 Received: from [130.125.5.94] (helo=mail-11.UNINE.CH) by columba.unine.ch stage1 with esmtps with id 1M1Lg2-0002Ju-4S for from ; Tue, 05 May 2009 16:31:22 +0200 Received: from mail-20.UNINE.CH (130.125.1.39) by mail-11.UNINE.CH (130.125.5.94) with Microsoft SMTP Server (TLS) id 8.1.340.0; Tue, 5 May 2009 16:30:57 +0200 Received: from MAIL-2.UNINE.CH ([130.125.5.116]) by MAIL-20.UNINE.CH ([130.125.1.39]) with mapi; Tue, 5 May 2009 16:30:55 +0200 From: HENRY Pierre To: "'user@struts.apache.org'" Date: Tue, 5 May 2009 16:30:54 +0200 Subject: Chaining actions specifying method name Thread-Topic: Chaining actions specifying method name Thread-Index: AcnNjhhNbM4P2I+hTmy/gHKJ7ItSTA== Message-ID: Accept-Language: fr-FR, fr-CH Content-Language: fr-FR X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: fr-FR, fr-CH Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Hi, I am new to Struts2 but after struggling a couple of weeks with the doc (ha= rd to find up-to-date doc for 2.1.6) and a couple out-of-date books, I am r= eally starting to appreciate the simplicity and flexibility ! I am using Struts 2.1.6. I have built a SecurityInterceptor, which checks authentication and permiss= ions of the user, in particular if the invocated action is authorized, base= d on the action name. The action name is read using : invocation.getProxy().getActionName(); I also tried=20 invocation.getInvocationContext().getName(); In general, invocation.getProxy().getActionName() returns the name of the a= ction, and as I use the action!method pattern in the URL I could also get t= he method from getMethodName(). Perfect. But then I have a navigation menu action which chains to the selected actio= n. The properties nextAction and nextNamespace are properties from the Menu= SelectAction : ${nextAction} ${nextNamespace} =20 It works fine but there is no "methodName" parameter possible for the chain= result, so I have to put the litteral "myAction!method" in the nextAction = property. Then the right action with the right method is invocated, but in = my interceptor the=20 invocation.getProxy().getActionName()=20 method returns "myAction!method" and the authorization check fails because = it should be looking only for "myAction". So we have two different behaviours, depending if the action was chained or= invocated directly. This is not so bad for me and I can easily find a work-around, but it might= be worth it to add a "methodName" parameter to the chain type result, and = then to invoke the action in the same manner than when it is invoked direct= ly ? Cheers and thanks for the good work ! Pierre= --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org