Hello,
I'm having some trouble binding to my command object with spring:bind in my jsp view. Here is the relevant code form my servlet.xml:
The "State" object looks like this:Code:<bean id="stateController" class="springdev.StateController"> <property name="sessionForm" value="true" /> <property name="commandName" value="state" /> <property name="commandClass" value="bus.State" /> <property name="formView" value="selectstate" />
And I am trying to bind to that State state object like so:Code:public class State implements Serializable { private List<County> counties; private String name; public List<County> getCounties() { return counties; } public void setCounties(List<County> counties) { this.counties = counties; } public String getName() { return name; } public void setName(String name) { this.name = name; } ...
Yet I am getting this error:Code:<spring:bind path="state.name">
org.apache.jasper.JasperException: Neither Errors instance nor plain target object for bean name 'state' available as request attribute
I've seen a few threads here which touch on similar issues people have, but they seem to involve more sophisticated usage of the bind tags. Personally I find the spring tag references to be lacking in exposition and code example, and as a result I might not be using the tags properly.
I think this is enough code to make sense of it (assume that my viewResolvers and web.xml are configured properly), but if you need more I'll be happy to provide it. Thanks!


Reply With Quote

