You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "recyclebin5385 (JIRA)" <ji...@apache.org> on 2013/08/24 15:37:51 UTC
[jira] [Created] (WW-4184) When a getter of an action calls
getText("getterName.something"), method call stack overflow occurs
recyclebin5385 created WW-4184:
----------------------------------
Summary: When a getter of an action calls getText("getterName.something"), method call stack overflow occurs
Key: WW-4184
URL: https://issues.apache.org/jira/browse/WW-4184
Project: Struts 2
Issue Type: Bug
Affects Versions: 2.3.15.1
Environment: Windows Vista, Java 7, Tomcat 7
Reporter: recyclebin5385
Priority: Trivial
Under a certain condition, calling a getter of an action causes method call stack overflow.
If a jsp file contains a <s:debug /> tag, it doesn't work and throws java.util.ConcurrentModificationException.
The condition is described below.
- The action class extends com.opensymphony.xwork2.ActionSupport.
- The action class has a getter and the getter calls the action class's method getText().
The argument of getText() is like "getterName.something".
If the getter is getFoo(), the argument is like 'foo.bar'.
- An *empty* properties file exists with the same name as the action class in the same package.
If the action class is TestAction, the name of the properties file is TestAction.properties
- The JSP file has tag <s:debug />.
It seems that <s:debug /> tries to call getFoo() and causes call stack overflow.
It has something to do with the problem?
1. <s:debug /> calls the action class's method getFoo().
2. getFoo() calls getText("foo.bar").
3. getText() calls LocalizedTextUtil.findText(Class aClass, String aTextName, Locale locale, String defaultMessage, Object[] args, ValueStack valueStack).
4. There is no property named foo.bar, so LocalizedTextUtil.findText() tries to get "foo.bar" from the value stack.
5. The action class instance is on the top of the value stack, so the action class's getFoo() is called.
6. Go back to 2. This loop continues infinitely....
--
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