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 23B8CE0EC for ; Thu, 17 Jan 2013 15:42:25 +0000 (UTC) Received: (qmail 2705 invoked by uid 500); 17 Jan 2013 15:42:25 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 2372 invoked by uid 500); 17 Jan 2013 15:42:24 -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 2286 invoked by uid 99); 17 Jan 2013 15:42:23 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jan 2013 15:42:23 +0000 Date: Thu, 17 Jan 2013 15:42:23 +0000 (UTC) From: "Greg Huber (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-3965) Double bang on form action 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-3965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13556320#comment-13556320 ] Greg Huber commented on WW-3965: -------------------------------- Yes, in the form I include the bang.... .. so the url will already have the bang from the mapping.getName(): {code:java} String name = mapping.getName(); String params = ""; if (name.indexOf('?') != -1) { params = name.substring(name.indexOf('?')); name = name.substring(0, name.indexOf('?')); } uri.append(name); {code} > Double bang on form action > -------------------------- > > Key: WW-3965 > URL: https://issues.apache.org/jira/browse/WW-3965 > Project: Struts 2 > Issue Type: Bug > Components: Core Actions > Affects Versions: 2.3.8 > Environment: Centos Apache/tomcat with mod_jk > Reporter: Greg Huber > Priority: Minor > Fix For: 2.3.10 > > Attachments: patch_WW-1967_WW-3965 .txt, patch_WW-3965 .txt > > > Hello, > I sometimes use the dynamic method invocation on the form action for submitting and have noticed for a while now, that there is a double bang on the compiled page: > eg. If I use action="license!member" on the compiled page I get > action="/events/license!member!member.action" > on the jsp: > > .. > > gives: >
> '' >
> It only seems to be on the form tag though. > Have traced it to DefaultActionMapper, line 539. It needs to check to make sure there is no bang already before adding another one, ie follow existing logic in other methods. > {code:java} > if (null != mapping.getMethod() && !"".equals(mapping.getMethod())) { > uri.append("!").append(mapping.getMethod()); > } > {code} > This seems to have fixed it: > {code:java} > //if (null != mapping.getMethod() && !"".equals(mapping.getMethod())) { > //uri.append("!").append(mapping.getMethod()); > //} > if (allowDynamicMethodCalls) { > if (null != mapping.getMethod() && !"".equals(mapping.getMethod())) { > // handle "name!method" convention. > name = mapping.getName(); > if (name.indexOf("!") == -1) { > // Append the method as no bang found > uri.append("!").append(mapping.getMethod()); > } > } > } else { > if (null != mapping.getMethod() && !"".equals(mapping.getMethod())) { > uri.append("!").append(mapping.getMethod()); > } > } > {code} > I would do a patch but I have already modified the DefaultActionMappe for WW-1967 which has still hopefully outstanding. > Cheers Greg. -- 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