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 C121DD254 for ; Fri, 18 Jan 2013 06:32:17 +0000 (UTC) Received: (qmail 8445 invoked by uid 500); 18 Jan 2013 06:32:16 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 8153 invoked by uid 500); 18 Jan 2013 06:32:16 -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 8105 invoked by uid 99); 18 Jan 2013 06:32:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jan 2013 06:32:15 +0000 Date: Fri, 18 Jan 2013 06:32:15 +0000 (UTC) From: "Lukasz Lenart (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-1967) Dynamic Method Invocation, validator with ActionName-aliasName-validation.xml files. 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-1967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13556999#comment-13556999 ] Lukasz Lenart commented on WW-1967: ----------------------------------- Waiting for path from [~gregh99] as mentioned in WW-3965 > Dynamic Method Invocation, validator with ActionName-aliasName-validation.xml files. > ------------------------------------------------------------------------------------ > > Key: WW-1967 > URL: https://issues.apache.org/jira/browse/WW-1967 > Project: Struts 2 > Issue Type: Bug > Components: Core Actions > Affects Versions: 2.0.6 > Environment: Fedora 4, tomcat > Reporter: Greg Huber > Priority: Minor > Fix For: 2.3.9 > > > Hello, > I have been trying to get validation working with dynamic method invocation, using ActionName-aliasName-validation.xml files. > When the struts.property is set >> struts.enable.DynamicMethodInvocation=true, in the DefaultActionMapper the mapping name is changed by removing !submit from the action eg fieldValidatorsExamples!submit becomes fieldValidatorsExamples. When the validator tries to find FieldValidatorsExampleAction-fieldValidatorsExamples!submit-validator.xml it cannot, as the validator is looking for FieldValidatorsExampleAction-fieldValidatorsExamples-validator.xml. But this is now not linked to a method. > if (allowDynamicMethodCalls) { > // handle "name!method" convention. > String name = mapping.getName(); > int exclamation = name.lastIndexOf("!"); > if (exclamation != -1) { > mapping.setName(name.substring(0, exclamation)); > mapping.setMethod(name.substring(exclamation + 1)); > } > } > With struts.enable.DynamicMethodInvocation=false, validator works but method name is null. > This line of code is causing the problem mapping.setName(name.substring(0, exclamation));. Without this line seems to work but I am no expert! > eg: > > /validation/fieldValidatorsExample.jsp > /validation/successFieldValidatorsExample.jsp > > > > > > > > > > > > > > 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