Hi all,
I have the following code and it gives me an exception can any one help me!
this is the bean for my checkbox.
Code:
package com.egysol.beans;
public class Checkbox {
private boolean checkbox;
public boolean isCheckbox() {
return checkbox;
}
public void setCheckbox(boolean checkbox) {
this.checkbox = checkbox;
}
}
//command for all checkboxs ..
package com.egysol.beans;
public class MyCheckBoxs {
private Checkbox [] checkbox;
public Checkbox[] getCheckbox() {
return checkbox;
}
public void setCheckboxs(Checkbox[] checkbox) {
this.checkbox = checkbox;
}
}
in the Application-servlet.xml i define the the controller bean and add command to its properties as
Code:
<property name="commandName">
<value>combobox</value>
</property>
<property name="commandClass">
<value>com.egysol.beans.MyCheckBoxs</value>
</property>
and in the jsp file i bind the command as follow..
Code:
<c:forEach var="eachElement" items="${data}" varStatus="status">
<tr>
<spring:bind path="combobox">
<td class="style5">
<input type="hidden" name="_<c:out value='${status.expression}'/>" />
<input type="checkbox" name="<c:out value='${status.expression}'/>" value="true" <c:if test="${status.value}">checked</c:if> />
</td>
</spring:bind>
</tr>
</c:forEach>
but when running this code it gives me the follwing exception
2006-08-07 12:53:42,828 ERROR [org.springframework.web.servlet.tags.BindTag] - <Neither Errors instance nor plain target object for bean name 'combobox' available as request attribute>
javax.servlet.jsp.JspTagException: Neither Errors instance nor plain target object for bean name 'combobox' available as request attribute
at org.springframework.web.servlet.tags.BindTag.doSta rtTagInternal(BindTag.java:118)
at org.springframework.web.servlet.tags.RequestContex tAwareTag.doStartTag(RequestContextAwareTag.java:6 8)
.
.
.
.
.
what is the problem?
and is this the right way for using spring ?
Thanks
M Elgamal