• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why this exception?

 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
aglib.html.BEAN
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:968)
at org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:176)
at org.apache.jsp.testvalidation_jsp._jspx_meth_html_text_8(testvalidation_jsp.java:701)
at org.apache.jsp.testvalidation_jsp._jspx_meth_html_form_0(testvalidation_jsp.java:339)
at org.apache.jsp.testvalidation_jsp._jspx_meth_html_html_0(testvalidation_jsp.java:150)
at org.apache.jsp.testvalidation_jsp._jspService(testvalidation_jsp.java:91)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Htt
p11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.ja
va:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic