struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukasz Lenart (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (WW-4184) When a getter of an action calls getText("getterName.something"), method call stack overflow occurs
Date Sat, 08 Mar 2014 17:14:43 GMT

     [ https://issues.apache.org/jira/browse/WW-4184?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Lukasz Lenart updated WW-4184:
------------------------------

    Fix Version/s:     (was: 2.3.17)
                   2.3.x

> 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: Minor
>             Fix For: 2.3.x
>
>         Attachments: WebContent.zip, src.zip
>
>
> 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 was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message