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 180DCE7B5 for ; Mon, 21 Jan 2013 11:04:14 +0000 (UTC) Received: (qmail 96149 invoked by uid 500); 21 Jan 2013 11:04:13 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 96113 invoked by uid 500); 21 Jan 2013 11:04: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 96082 invoked by uid 99); 21 Jan 2013 11:04:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jan 2013 11:04:13 +0000 Date: Mon, 21 Jan 2013 11:04:13 +0000 (UTC) From: "Lukasz Lenart (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (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:all-tabpanel ] Lukasz Lenart resolved WW-1967. ------------------------------- Resolution: Not A Problem Assignee: Lukasz Lenart > 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 > Assignee: Lukasz Lenart > Priority: Minor > Fix For: 2.3.9 > > Attachments: patch_WW-1967.txt, patch_WW-1967_xwork_2.txt > > > 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. > {code:java} > 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)); > } > } > {code} > 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: > {code:xml} > > /validation/fieldValidatorsExample.jsp > /validation/successFieldValidatorsExample.jsp > > {code} > {code:html} > > > > > > > > > > > > > {code} > 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