wood burning stoves 2.0*
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "why this exception?" Watch "why this exception?" New topic
Author

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
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)


A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41571
    
  54
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?


Ping & DNS - my free Android networking tools app
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
 
 
subject: why this exception?