Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error in my struts application no getter methods

 
sahana mithra
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my entire code.





[img]
ApplicationResource.properties
Employee_Details.title=Employee Details
prompt.id=Employee ID
prompt.name=Employee Name
prompt.salary=Employee Salary
button.submit=submit
button.reset=reset

error.EmpName.required = User Name is required.
error.EmpId.required = Password is required.
error.EmpSal.required = Salary is required[/img]

















I get only the below error. Please help me
[img]HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: No getter method for property: "EmpID" of bean: "employeeForm"
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause

javax.servlet.ServletException: javax.servlet.jsp.JspException: No getter method for property: "EmpID" of bean: "employeeForm"
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.Employee_005fDetails_jsp._jspService(Employee_005fDetails_jsp.java:115)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause

javax.servlet.jsp.JspException: No getter method for property: "EmpID" of bean: "employeeForm"
org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:987)
org.apache.struts.taglib.html.BaseFieldTag.prepareValue(BaseFieldTag.java:121)
org.apache.struts.taglib.html.BaseFieldTag.renderInputElement(BaseFieldTag.java:102)
org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:81)
org.apache.jsp.Employee_005fDetails_jsp._jspx_meth_html_005ftext_005f0(Employee_005fDetails_jsp.java:256)
org.apache.jsp.Employee_005fDetails_jsp._jspx_meth_html_005fform_005f0(Employee_005fDetails_jsp.java:179)
org.apache.jsp.Employee_005fDetails_jsp._jspService(Employee_005fDetails_jsp.java:105)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.29 logs.


--------------------------------------------------------------------------------

Apache Tomcat/6.0.29[/img]
 
Dheeraj dubey
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your GradeForm class

instate of



Use



 
sahana mithra
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I changed as you told but still its not working...
 
Reyaz Ahmed
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The name of the attribute in ActionForm must start with small letter like in this case

public class GradeForm extends ActionForm{

private static final long serialVersionUID = 1L;
private String empID;
private String empName;
private int empSal;

// and after that generate the getter and setter of the above attribute

}

I think it will solved your problem


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic