Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

html:multibox

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<html:multibox name="privileges" property="privilegeID">
<bean:write name="privileges" property="privilegeID"/>
</html:multibox>

here name is the iterate id.
and property is your formbean property..like that .....
 
Jayesh Sisodiya
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<html:multibox name="privileges" property="privilegeID">
<bean:write name="privileges" property="privilegeID"/>
</html:multibox>

here name is the iterate id.
and property is your formbean property..like that .....
 
Jayesh Sisodiya
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<html:multibox name="privileges" property="privilegeID">
<bean:write name="privileges" property="privilegeID"/>
</html:multibox>

here name is the iterate id.
and property is your formbean property..like that .....
 
Oh. Hi guys! Look at this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic