The field name for field "foo[1].bar[2].baz" should be obtained from key "foo.bar.baz" in StripesResources.properties. Currently, it is obtained from key "foo.baz".
In the following test case, entering "x" on the text field generates
Please fix the following errors:
1. The value (x) entered in field Wrong must be a valid number
The expected message is "... in field Correct ..."
==> BarType.java <==
package com.myco.action;
public class BarType {
private Integer baz;
public Integer getBaz() { return baz; }
public void setBaz(Integer baz) { this.baz = baz; }
}
==> FooType.java <==
package com.myco.action;
import java.util.*;
public class FooType {
private Map<String, BarType> bar = new HashMap<String, BarType>();
public Map<String, BarType> getBar() { return bar; }
public void setBar(Map<String, BarType> bar) { this.bar = bar; }
}
==> TestAction.java <==
package com.myco.action;
import java.util.*;
import net.sourceforge.stripes.action.*;
public class TestAction implements ActionBean {
private ActionBeanContext context;
public ActionBeanContext getContext() { return context; }
public void setContext(ActionBeanContext context) {
this.context = context;
}
private Map<String, FooType> foo = new HashMap<String, FooType>();
public Map<String, FooType> getFoo() { return foo; }
public void setFoo(Map<String, FooType> foo) { this.foo = foo; }
public Resolution nothing() {
return getContext().getSourcePageResolution();
}
}
==> StripesResources.properties <== (add these)
foo.baz=Wrong
foo.bar.baz=Correct
==> index.jsp <==
<%@ taglib prefix="stripes" uri="
http://stripes.sourceforge.net/stripes.tld" %>
<stripes:form beanclass="com.myco.action.TestAction">
<stripes:errors/>
<stripes:text name="foo[1].bar[2].baz"/>
<stripes:submit name="nothing"/>
</stripes:form>
==> (end) <==