Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes Struts and the fly likes why this exception? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "why this exception?" Watch "why this exception?" New topic

why this exception?

saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
hi i am using creditcard filed with validations
so while running htis application it gives an exception
please can any one tell me what to do for this excewption?

- Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: No getter method for property creditCard of bean org.apache.struts.t
at org.apache.struts.util.RequestUtils.lookup(
at org.apache.struts.taglib.html.BaseFieldTag.doStartTag(
at org.apache.jsp.testvalidation_jsp._jspx_meth_html_text_8(
at org.apache.jsp.testvalidation_jsp._jspx_meth_html_form_0(
at org.apache.jsp.testvalidation_jsp._jspx_meth_html_html_0(
at org.apache.jsp.testvalidation_jsp._jspService(
at org.apache.jasper.runtime.HttpJspBase.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.jasper.servlet.JspServletWrapper.service(
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
at org.apache.jasper.servlet.JspServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
at org.apache.catalina.core.ApplicationFilterChain.doFilter(

at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Htt
at org.apache.tomcat.util.threads.ThreadPool$
at Source)

SCJP 1.4
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42954
Apparently Struts doesn't think that the declaration of the CC field and its accessor methods meet the requirements of a bean. What do the field and method declarations look like?
saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
thanks i got it,

hmm the problem was i havn't declared setter and getter for credit card filed in FormBean class

now it is working well

but i have one doubt
but here i've seen it by the help of debug statements(sop),after submitting the form in jsp the control goes to Form class(bean) and then to action class(controller)

but according to MVC after jsp the control must go to controller where the request is handled and according to the request it must forward to the bean
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
It sounds like you could use some time with a decent book on Struts. Your action class is just part of the "controller" portion of your Struts application. It is the StrutsServlet that will handle the request and pass off processing to the RequestProcessor. These two classes are also part of the controller. The RequestProcessor will only call the execute method on your action if the form passes validation.

- Brent
I agree. Here's the link:
subject: why this exception?