From issues-return-31803-archive-asf-public=cust-asf.ponee.io@struts.apache.org Tue Feb 13 13:29:05 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id B65AC180656 for ; Tue, 13 Feb 2018 13:29:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A6041160C53; Tue, 13 Feb 2018 12:29:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id ECBD0160C50 for ; Tue, 13 Feb 2018 13:29:04 +0100 (CET) Received: (qmail 3909 invoked by uid 500); 13 Feb 2018 12:29:04 -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 3899 invoked by uid 99); 13 Feb 2018 12:29:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Feb 2018 12:29:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 8788B1A0AD3 for ; Tue, 13 Feb 2018 12:29:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -101.511 X-Spam-Level: X-Spam-Status: No, score=-101.511 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id CeoleYixHMMR for ; Tue, 13 Feb 2018 12:29:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 3CCA15F1ED for ; Tue, 13 Feb 2018 12:29:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 67A80E0026 for ; Tue, 13 Feb 2018 12:29:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 22D3D21E85 for ; Tue, 13 Feb 2018 12:29:00 +0000 (UTC) Date: Tue, 13 Feb 2018 12:29:00 +0000 (UTC) From: "Nate (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-4918) buttons with name="method:METHODNAME" sometimes ignore global-allowed-methods defined in struts.xml 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-4918?page=3Dcom.atlassian.ji= ra.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1636221= 7#comment-16362217 ]=20 Nate commented on WW-4918: -------------------------- [~yasser.zamani] As far as I can tell, we do not use a specific Struts2 RES= T plugin (at least, there isn't something like struts-rest-plugin in the iv= y library list, and our REST API seems to be homebrew, using jackson, javax= and xerces based on the ivy dependencies). the REST API also doesn't appea= r to have delete and update methods, being readonly. > buttons with name=3D"method:METHODNAME" sometimes ignore global-allowed-m= ethods defined in struts.xml > -------------------------------------------------------------------------= -------------------------- > > Key: WW-4918 > URL: https://issues.apache.org/jira/browse/WW-4918 > Project: Struts 2 > Issue Type: Bug > Components: Core Actions > Reporter: Nate > Priority: Major > > I have the following action (slightly edited to remove identifying info): > {code:xml} > > > > dojo\..*,struts\..*,d-\d+?-[sop],..= *multiselect..* > globalAdmin > > > input,back,refresh,cancel,browse > > > > /jsp/user/userEdit.jsp > > displayUserEdit.action > > > userOverviewRetained.action > info.transaction_success > > /jsp/user/userEdit.jsp > ${backUrl} > > {code} > And the following global allowed methods: > {code:xml} > update,execute > {code} > And these buttons: > =C2=A0 > {code:xml} >
> <%-- The 'Save' button --%> > type=3D"submit" class=3D"button" name=3D"method:update" /> > <%-- The 'Refresh' button --%> > type=3D"submit" class=3D"button" name=3D"method:refresh" > id=3D"refreshButton" /> > <%-- The 'Back' button --%> > type=3D"submit" class=3D"button" name=3D"method:back" /> >
> {code} > =C2=A0 > As you can see, the update method is defined in the global-allowed-action= s list, but the refresh and back methods aren't. However, what happens is t= hat the update button with the update method works and updates the user, th= e refresh action shows the "method is not allowed" error screen and doesn't= update the user(both as expected since update is defined in the allowed me= thods and refresh isn't), but the back button DOES actually work even thoug= h it's not explicitly defined in the global-allowed-methods section. > =C2=A0 > I'm trying to understand why out of 2 methods both not defined as allowed= -methods, one is correctly=C2=A0blocked=C2=A0 as "not allowed" while the ot= her is still allowed through. If I add ",refresh" to the global-allowed-met= hods and restart tomcat, the refresh button ends up working afterwards as e= xpected, and the back button stays functional. I don't use the plugin that = adds the=C2=A0Allowed Methods=C2=A0annotation, and this same situation also= happens when using s:submits with method=3D"back" defined, even if there i= s already a method defined on the action entry in struts.xml. > Update: I have done some more testing, and it appears that another action= with similar definition but a different method (method:delete on an AntDel= eteAction) also works without having to explicitly define delete on the glo= bal allowed methods list. -- This message was sent by Atlassian JIRA (v7.6.3#76005)