This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in calling a method in my Action

 
Ramesh Jothimani
Ranch Hand
Posts: 70
Android Eclipse IDE Hibernate
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a method named handleReportUpdate() in my ReportsConfigurationAction.java . When I try to call handleReportUpdate , I am getting error as ,

java.lang.NoSuchMethodException: com.tcs.admin.actions.ReportsConfigurationAction.handleReportUpdate(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
at java.lang.Class.getMethod(Class.java:1605)
at org.apache.struts.actions.DispatchAction.getMethod(DispatchAction.java:334)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:266)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

The Method is as follows :




The entry in struts-config file is as follows :



I am calling the handleReportUpdate() as follows :

/reportsconfig.do?parameter=handleReportUpdate



Please help me to solve the issue . Thanks !

 
Vivek Kanodia
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are probably getting the Exception because the method expected is
public ActionForward execute(ActionMapping mapping,
ActionForm form,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.lang.Exception. Just try changing the method name and it might solve your problem.
 
Ramesh Jothimani
Ranch Hand
Posts: 70
Android Eclipse IDE Hibernate
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have changed



to



So the method handleReportUpdate() requires ActionForm in the parameter. I have passed ActionForm in function parameter & it is working fine now.

Thanks !
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic