iam new to
struts i cant retrieve values from database using html:multibox
error is :
org.apache.jasper.JasperException: Exception in
JSP: /jsp/Check.jsp:19
16: </head>
17: <body>
18: <html:form action="Check" method="post">
19: <logic:iterate id="item" property="check" name="checkForm">
20: <html:multibox property="check" name="checkForm">
21: <bean:write name="item"/>
22: </html:multibox>
javax.servlet.ServletException: No getter method for property: "check" of bean: "checkForm"
this is my jsp page:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ page import="jobportal.beans.Check"%>
<%@ page import="jobportal.struts.actionform.CheckForm"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Check</title>
</head>
<body>
<html:form action="Check" method="post">
<logic:iterate id="item" property="check" name="checkForm">
<html:multibox property="check" name="checkForm">
<bean:write name="item"/>
</html:multibox>
<bean:write name="item"/>
</logic:iterate>
<
</html:form>
my form bean:
package jobportal.struts.actionform;
import jobportal.beans.*;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
public class CheckForm extends ActionForm {
private
String employeeStatus;
public String getEmployeeStatus() {
return employeeStatus;
}
public void setEmployeeStatus(String employeeStatus) {
this.employeeStatus = employeeStatus;
}
}
my dao is :
public ArrayList getCheck(HttpServletRequest request,String path,String uName) throws Exception
{
SQLExecuter sqlExe = new SQLExecuter(this.path,JobPortalConstants.DATA_SOURCE_KEY);
ArrayList arraylist=null;
try
{
java.sql.ResultSet rs = sqlExe.executeSql2("GetCheck", new String[0]);
arraylist=new ArrayList();
while(rs.next())
{
System.out.println("gdsd");
String employeeStatus=rs.getString(1);
Check check =new Check();
check.setEmployeeStatus(employeeStatus);
arraylist.add(check);
}
sqlExe.closeConnection();
} catch (Exception e) {
System.out.println("CheckActionsexception"+e);
sqlExe.closeConnection();
throw e;
}
return arraylist ;
}
}
my action class is:
public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws IOException, ServletException {
ActionMessages msgs = new ActionMessages();
//String target = "failure2";
ActionErrors errors = new ActionErrors();
try{
String path = this.getServlet().getServletContext()
.getRealPath("/");
String uName="kizar";
System.out.println("name"+uName);
CheckForm checkForm=(CheckForm)form;
CheckActions checkactions=new CheckActions(checkForm,uName);
ArrayList list=checkactions.getCheck(request, path, uName);
request.setAttribute("check", list);
} catch (Exception e) {
System.out.println("actionPage"+e);
java.io.StringWriter sw = new java.io.StringWriter();
java.io.PrintWriter pw = new java.io.PrintWriter(sw);
e.printStackTrace(pw);
logger.fatal(sw.toString());
} finally {
}
return mapping.findForward("check");
}
can any one solve my problem