[
https://issues.apache.org/jira/browse/WW-3268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13170177#comment-13170177
]
JB edited comment on WW-3268 at 12/15/11 1:09 PM:
--------------------------------------------------
I am unable to reproduce this issue. My sample Maven project is running Struts
2 version 2.2.3.
My test IndexAction contains a collection of User bean instances. The User
beans contain the following simple String properties: name and parameters.
{code}
public class User {
private String name;
private String paramters;
public String getParamters() {
return paramters;
}
public void setParamters(String paramters) {
this.paramters = paramters;
}
...
{code}
I have included a toString() method that returns the user's name.
{code}
...
@Override
public String toString() {
return "The users name is "+ this.getName();
}
...
{code}
My index.jsp contains the following code-fragment:
{code}
<s:select name="username"
list="users"
listKey="name"
listValue="name"
label="Select a user" />
{code}
The following "Select" is rendered:
{code}
<select name="username" id="showProblem_username">
<option value="Jeff">Jeff</option>
<option value="Chelley">Chelley</option>
<option value="Maddie">Maddie</option>
<option value="Cooper">Cooper</option>
</select>
{code}
was (Author: jeffblack360):
I am unable to reproduce this issue. My sample Maven project is running
Struts 2 version 2.2.3.
My test IndexAction contains a collection of User bean instances. The User
beans contain the following simple String properties: name and parameters.
{code}
public class User {
private String name;
private String paramters;
public String getParamters() {
return paramters;
}
public void setParamters(String paramters) {
this.paramters = paramters;
}
...
{code}
I have included a toString() method that returns the user's name.
{code}
...
@Override
public String toString() {
return "The users name is "+ this.getName();
}
...
{code}
My index.jsp contains the following code-fragment:
{code}
<s:select name="username"
list='users'
listKey="name"
listValue="name"
label="Select a user" />
{code}
The following "Select" is rendered:
{code}
<select name="username" id="showProblem_username">
<option value="Jeff">Jeff</option>
<option value="Chelley">Chelley</option>
<option value="Maddie">Maddie</option>
<option value="Cooper">Cooper</option>
</select>
{code}
> problem with property named "parameters" in my bean
> ---------------------------------------------------
>
> Key: WW-3268
> URL: https://issues.apache.org/jira/browse/WW-3268
> Project: Struts 2
> Issue Type: Improvement
> Components: Documentation
> Reporter: Rodrigo Canabrava
> Fix For: 2.3.x
>
>
> I had a problem with the tag <s:select/> that did not render correctly. It
> ignored the properties that I wanted to use as key and value from my beans,
> and instead it used the toString() method of my bean. After renaming the bean
> class and removing all properties, and inserting one by one, I found out that
> the problem was due to a property named 'parameters' in my bean.
> So I guess this word is 'reserved', and there should be a warning in the tags
> documentation that this word cannot be used as a property in my beans, even
> if I don't use the property in any tag.
> There is a conflict issue with this word. And I guess there might be other
> words that could result in the same conflict.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira