From issues-return-18876-apmail-struts-issues-archive=struts.apache.org@struts.apache.org Tue Oct 16 14:11:05 2012 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 5AB2ADAC1 for ; Tue, 16 Oct 2012 14:11:05 +0000 (UTC) Received: (qmail 64040 invoked by uid 500); 16 Oct 2012 14:11:03 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 64008 invoked by uid 500); 16 Oct 2012 14:11:03 -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 63933 invoked by uid 99); 16 Oct 2012 14:11:03 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Oct 2012 14:11:03 +0000 Date: Tue, 16 Oct 2012 14:11:03 +0000 (UTC) From: "Javier Lecuona (JIRA)" To: issues@struts.apache.org Message-ID: <517807743.51448.1350396663479.JavaMail.jiratomcat@arcas> In-Reply-To: <1236078912.47327.1350333783306.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (WW-3898) Redirect Action calls wrong method 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-3898?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Javier Lecuona updated WW-3898: ------------------------------- Attachment: test-struts2.zip Ok, here is my project with maven. just run mvn tomcat:run and it should be ready to test > Redirect Action calls wrong method > ---------------------------------- > > Key: WW-3898 > URL: https://issues.apache.org/jira/browse/WW-3898 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - Spring > Affects Versions: 2.3.4, 2.3.4.1 > Environment: Mac OS X Lion 10.7.4 > java version "1.6.0_35" > Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811) > Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode) > Reporter: Javier Lecuona > Labels: Bug, Spring > Fix For: 2.3.6 > > Attachments: test-struts2.zip, test.zip > > > I call an action and expect to be redirected to another action BUT instead I get java.lang.NoSuchMethodException. In my example Spring is in charge of constructing my Action object and I have a naive object that returns a random String. It turns out that this random string is being somehow mistaken by the action name, so I get something like java.lang.NoSuchMethodException: test.action.Test.TSldxhPcLq(). > I've made a simple project that is very simple to test. > In the following example you can call "redirect" action and see the bug. I have a small zip with this test project but I'm not finding any upload button. > Here is my config > struts.xml > {code:xml} > > "-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN" > "http://struts.apache.org/dtds/struts-2.1.7.dtd"> > > > > > > > class="test.action.Test"> > /jsp/test.jsp > > > class="test.action.Redirect"> > test > > > > > {code} > ApplicationContext.xml > {code:xml} > > > xmlns:security="http://www.springframework.org/schema/security" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" > xmlns:tx="http://www.springframework.org/schema/tx" xmlns:task="http://www.springframework.org/schema/task" > xsi:schemaLocation=" > http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"> > > > 10 > > > > {code} > Test.java > {code:java} > public class Test { > > public String test(){ > return ActionSupport.SUCCESS; > } > } > {code} > Redirect.java > {code:java} > public class Redirect { > > public String redirect(){ > return ActionSupport.SUCCESS; > } > } > {code} > RandomString.java > {code:java} > public class RandomString { > public RandomString() { > } > public static char createChar(int temp) { > return (char) temp; > } > public static int createInt(char temp) { > return (int) temp; > } > public static void createAsciiTable() { > for (int z = 0; z < 256; z++) { > char[] test3; > test3 = new char[1]; > test3[0] = RandomString.createChar(z); > String test2 = new String(test3); > byte[] t3; > t3 = test2.getBytes(); > int a2 = t3[0]; > int a3 = (a2 & 0x7F) + (a2 < 0 ? 128 : 0); > System.out.println("mitChar: " + RandomString.createChar(z) + " " > + RandomString.createInt(RandomString.createChar(z)) > + " mitString: " + test2 + " " + a3); > } > } > public static char createRandomChar() { > int temp = new Random().nextInt(256); // limitation of Ascii Char 33 to > // 255 > if ((temp < 48) || (temp > 47 && temp < 65) || (temp > 90 && temp < 97) > || (temp > 122)) > { > temp = createRandomChar(); > return (char) temp; > } > else { > // System.out.println(temp); > return (char) temp; > } > } > public static String createRandomString(int length) { > StringBuffer sb = new StringBuffer(); > for (int j = 0; j < length; j++) { > sb.append(createRandomChar()); > } > return sb.toString(); > } > } > {code} -- 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