title: javax.servlet.ServletException: java.lang.NoSuchMethodException: Action[/common/DepartmentAction] does not contain specified method
body: <p>i am getting above exception but i have the action class and method in that Actionclass which i call.</p>
  
  <p>this is the struts-config.xml.</p>
  
  <pre><code>&lt;action path="/common/DepartmentAction"  name="SecurEyesForm" type="com.secureyes.eswastha.struts.action.DepartmentAction" scope="request" parameter="method" validate="false"&gt;
     &lt;forward name="departmentHome" path="/WEB-INF/Masters/DepartmentMaster.jsp"&gt;&lt;/forward&gt;            
  &lt;/action&gt;
  </code></pre>
  
  <p>and this is what is my Action class :</p>
  
  <pre><code>public class DepartmentAction extends DispatchAction {    
      /* forward name="success" path="" */
      private String forwardRequestTo = "success";
      public ActionForward goToHome(ActionMapping mapping, ActionForm form,
              HttpServletRequest request, HttpServletResponse response)
              throws Exception {
          //call method to verify Pagetoken
          forwardRequestTo = "departmentHome";
          return mapping.findForward(forwardRequestTo);
      }
  }
  </code></pre>
  
  <p>and this is how i call the method in javascript : </p>
  
  <pre><code>function dataSave(){                    
      document.forms[0].action="DepartmentAction.htm";
      document.forms[0].method.value="saveDepartmentDetails";
      document.forms[0].target="workFrame";
      document.forms[0].submit();   
  }
  </code></pre>
  
  <p>when i see the stack trace i see something like this : </p>
  
  <pre><code>SEVERE: Action[/common/DepartmentAction] does not contain method named ''
  
  By which should i to conclude that the method parameter is '' but i have given parameter as method.
  </code></pre>
  
  <p>StackTrace : </p>
  
  <pre><code>Oct 23, 2012 12:29:50 PM org.apache.struts.actions.DispatchAction dispatchMethod
  SEVERE: Action[/common/DepartmentAction] does not contain method named ''
  java.lang.NoSuchMethodException: com.secureyes.eswastha.struts.action.DepartmentAction.(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:1622)
      at org.apache.struts.actions.DispatchAction.getMethod(DispatchAction.java:348)
      at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:252)
      at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)
  
  Oct 23, 2012 12:29:50 PM org.apache.struts.util.PropertyMessageResources loadLocale
  WARNING:   Resource org/apache/struts/action/ActionResources_en_US.properties Not Found.
  Oct 23, 2012 12:29:50 PM org.apache.struts.util.PropertyMessageResources loadLocale
  WARNING:   Resource org/apache/struts/action/ActionResources_en.properties Not Found.
  Oct 23, 2012 12:29:50 PM org.apache.struts.action.RequestProcessor processException
  WARNING: Unhandled Exception thrown: class java.lang.NoSuchMethodException
  </code></pre>
  
  <p>Is this version problem of struts framework, because of dispatch action in 1.29 and the version configured with my project is 1.3.9?. if it is version problem how to configure struts 1.2.9 to Netbeans7.2 IDE?`</p>
  
  <p>UPDATE : </p>
  
  <p>Home page which has all the frames</p>
  
  
  
  
  
  
  
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"&gt;
  &lt;html&gt;&lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;link rel="shortcut icon" href="favicon.ico"&gt;
  &lt;title&gt;SecureEyes - Infusing Security&lt;/title&gt;
  &lt;script language="javascript" type="text/javascript" src="&lt;%=resourcePath%&gt;/scripts/frameset.js"&gt;&lt;/script&gt;
  &lt;script language="javascript" type="text/javascript" src="&lt;%=resourcePath%&gt;/scripts/commonForHomePageTemplate.js"&gt;&lt;/script&gt;
  &lt;script language="javascript"&gt;
  &lt;!--
  var opt_no_frames = false;
  var opt_integrated_mode = false;
  var _help_prefix = "";
  var _help_module = "";
  var _context = "";
  //--&gt;
  &lt;/script&gt;
  &lt;/head&gt;
              &lt;frameset border="0" frameborder="0" framespacing="0" rows="64,*"&gt;
                      &lt;frame border="0" frameborder="0" framespacing="0" id="topFrame" name="topFrame" src="&lt;%=resourcePath%&gt;/common/header.jsp" marginheight="0" marginwidth="0" noresize="noresize" scrolling="no"&gt;
                      &lt;frameset border="0" frameborder="0" framespacing="0" id="MainFrameSet" cols="209,*"&gt;
                              &lt;frame noresize="noresize" border="0" frameborder="0" framespacing="0" id="leftFrame" name="leftFrame" src="&lt;%=resourcePath%&gt;/common/left_menu.jsp" &gt;
                              &lt;frame border="0" frameborder="0" framespacing="0" id="workFrame" name="workFrame" src="&lt;%=resourcePath%&gt;/common/WelcomePage.jsp" marginheight="7" marginwidth="7" noresize="noresize" scrolling="auto"&gt;
                      &lt;/frameset&gt;
              &lt;/frameset&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and <code>DepartemtMaster.jsp</code></p>
  
  <p>&lt;%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
  &lt;%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
  &lt;%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
  &lt;%@ page contentType="text/html"%>
  &lt;%@ page pageEncoding="UTF-8"%>
  &lt;%
      String resourcePath = request.getContextPath();
  %>
  
  
      
          
          SecureEyes - Infusing Security
          </p>
  
  <pre><code>    &lt;link rel="stylesheet" type="text/css" href="&lt;%=resourcePath %&gt;/css/autocomplete.css"/&gt;
  </code></pre>
  
  /scripts/prototype/prototype.js">
  
  /scripts/script.aculo.us/effects.js">
  
  /scripts/script.aculo.us/controls.js">
  
  /scripts/autocomplete.js">
  
  <pre><code>    &lt;script src="&lt;%=resourcePath%&gt;/scripts/blanket.js"&gt;&lt;/script&gt;
  
  
      &lt;script src="&lt;%=resourcePath%&gt;/data-page/jquery-latest.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="&lt;%=resourcePath%&gt;/data-page/jquery.tablesorter.js"&gt;&lt;/script&gt;
      &lt;link href="&lt;%=resourcePath%&gt;/data-page/table-sorter.css" rel="stylesheet" type="text/css"&gt;
      &lt;link href="&lt;%=resourcePath%&gt;/css/eswastha.css" rel="stylesheet" type="text/css"&gt;
      &lt;script src="&lt;%=resourcePath%&gt;/data-page/smartpaginator.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;link href="&lt;%=resourcePath%&gt;/data-page/smartpaginator.css" rel="stylesheet" type="text/css" /&gt;
  
      &lt;script language="javascript" type="text/javascript" src="&lt;%=resourcePath%&gt;/scripts/commonForHomePageTemplate.js"&gt;&lt;/script&gt;
      &lt;script language="javascript" type="text/javascript" src="&lt;%=resourcePath%&gt;/data-page/main.js"&gt;&lt;/script&gt;
      &lt;script language="javascript" type="text/javascript" src="&lt;%=resourcePath%&gt;/header_data/tooltip.js"&gt;&lt;/script&gt;
      &lt;link rel="stylesheet" type="text/css" href="&lt;%=resourcePath%&gt;/header_data/general.css"&gt;
      &lt;link rel="stylesheet" type="text/css" href="&lt;%=resourcePath%&gt;/data-page/custom.css"&gt;
      &lt;link rel="stylesheet" type="text/css" href="&lt;%=resourcePath%&gt;/data-page/layout.css"&gt;
      &lt;link rel="stylesheet" type="text/css" href="&lt;%=resourcePath%&gt;/data-page/desktop.css"&gt;
      &lt;script src="&lt;%=resourcePath%&gt;/data-page/custom.js"&gt;&lt;/script&gt;
      &lt;link rel="stylesheet" type="text/nonsense" href="&lt;%=resourcePath%&gt;/header_data/misc.css"&gt;
  
      &lt;script src="../dwr/interface/DepartmentAction.js"&gt;&lt;/script&gt;
      &lt;script src="../dwr/engine.js"&gt;&lt;/script&gt;
      &lt;script src="../dwr/util.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
  
          function updateList(autocompleter, textBoxValue) {
              document.getElementById("INST_ID_LOADER").style.display = 'none';
              if(textBoxValue!=null &amp;&amp; textBoxValue!="" &amp;&amp; textBoxValue.length&gt;0){
                  document.getElementById("INST_ID_LOADER").style.display = '';
                  DepartmentAction.getAutocompleteDepartMentData(textBoxValue,function(data) {
                      document.getElementById("INST_ID_LOADER").style.display = 'none';
                      autocompleter.setChoices(data)
                  });
              }
          }
          function nameValueSelector(tag){
              return tag;
          }
          function isDepartmentExist(){
              var departmentName= document.getElementById('department').value;
              DepartmentAction.isDepartmentExist(departmentName,isDepartmentTrue);
          }
          function isDepartmentTrue(isDepartmentExist){
              if(isDepartmentExist){
                   document.getElementById('department').value="";
                   alert("Department exist already");
                  return false;
              }
          }
  
          function getDepartmentData(){
              var departmentName= document.getElementById('departmentName').value;
              DepartmentAction.getDepartmentResultHTML(departmentName,loadDepartmentHTML);
          }
          function loadDepartmentHTML(htmlTable){
              if(htmlTable){
                  document.getElementById("departmentList").style.display = "";
                  document.getElementById("departmentList").innerHTML = htmlTable;
                  document.getElementById("total").value="20";
                  //for paginator
                  t=40;
                  r=0;
                  $(function () {
                      r = document.getElementById('rec_per_page').value;
                      $('#paginator').smartpaginator({ totalrecords: t, recordsperpage: 10, datacontainer: 'product-table', dataelement: 'tr', initval: 0, next: 'Next', prev: 'Prev', first: 'First', last: 'Last'});
                  });
                  prepareForSearch();
  
              }
          }
          function prepareForSearch(){
              $(function() {      
                  $("#product-table").tablesorter();
              }); 
  
          }
          function deleteDepartment(departmentid){
              if(confirm("Are you sure to delete")){
                  alert("departmentid : D :"+departmentid);
              }
  
          }
          function updateDepartment(departmentid){
              if(confirm("Are you sure to Update")){
                  alert("departmentid : U :"+departmentid);
              }
          }
          function addDepartment(){
              document.getElementById("addDepartment").style.display = '';
          }
          function cancelAddDepartment(departmentid){
              document.getElementById("addDepartment").style.display = 'none';
          }
          function saveDepartment(){ 
              var department= document.getElementById('department').value;
              if(department.length&lt;=0){
                  alert("Please Enter Department Name");
                  return false;
              }else {
                  var answer = confirm("Do You Want to Continue?");
                  if (answer){
                      dataSave();
                  }
              }
          }
          function dataSave(){
              getBlanket('continueDIV');
              document.forms[0].action="DepartmentAction.htm?method=saveDepartmentDetails";
              document.forms[0].method.value="saveDepartmentDetails";
              document.forms[0].target="workFrame";
              document.forms[0].submit();   
          }
  
  
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body &gt;
      &lt;div id="blanket" style="display:none;"&gt;&lt;/div&gt;
      &lt;div id="continueDIV" style="display:none;" align="center" class="loadingRequest"&gt;
          &lt;img src="&lt;%=resourcePath%&gt;/images/loading_1.gif" align="middle" border="0"&gt;&lt;br /&gt;&lt;bean:message key="reqinprogress" /&gt;
      &lt;/div&gt;
      &lt;form method="get" autocomplete="off"&gt;
          &lt;table style="display: none;" id="loaderContainer" onclick="return false;" border="0" cellpadding="0" cellspacing="0" width="100%"&gt;
              &lt;tbody&gt;&lt;tr&gt;&lt;td id="loaderContainerWH"&gt;&lt;div id="loader" style="z-index: 10;"&gt;&lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;p&gt;&lt;img alt="1x1.gif" title="" id="loaderAnimation" style="background-image: url(/skins/vista/images/loading.gif);" src="left_data/1x1.gif" height="20" width="20"&gt;&lt;strong&gt;Please wait. Loading...&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;script language="JavaScript" type="text/javascript"&gt;_lanim_start(24, 20);&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
          &lt;table id="pageLayout" border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td id="screenWH"&gt;
                          &lt;div class="titleWrapper"&gt;
                              &lt;div class="pathbar clear"&gt;
                                  &lt;span class="pathbarItem"&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/span&gt;
                                  &lt;span class="pathbarItem separator"&gt;&amp;gt;&lt;/span&gt;
                              &lt;/div&gt;
                              &lt;div class="screenTitle"&gt;
                                  &lt;table cellspacing="0" width="100%"&gt;
                                      &lt;tbody&gt;&lt;tr&gt;
                                              &lt;td class="title"&gt;
                                                  &lt;div class="titleContainer clear"&gt;&lt;h1&gt;Master: Department&lt;/h1&gt;&lt;/div&gt;
                                              &lt;/td&gt;
                                          &lt;/tr&gt;
                                      &lt;/tbody&gt;&lt;/table&gt;
                              &lt;/div&gt;  
                          &lt;/div&gt;
                          &lt;div id="addDepartment" style="display: none"&gt;
                              &lt;table id="commonBodyTable" border="0" cellspacing="0" cellpadding="0" align="center"&gt;
                                  &lt;tr&gt;
                                      &lt;td&gt;
                                          &lt;table width="100%" align="center" class="tableBorder2" border="0" cellpadding="2" cellspacing="0"&gt;
                                              &lt;tr&gt;
                                                  &lt;td colspan="4" class="mainheader"&gt;Add Department&lt;/td&gt;
                                              &lt;/tr&gt;
                                              &lt;tr class="lightrow"&gt;
                                                  &lt;td width="30%" class="textalign"&gt;&amp;nbsp;&lt;/td&gt;
                                                  &lt;td width="5%" class="mandatory"&gt;&amp;nbsp;&lt;/td&gt;
                                                  &lt;td width="65%" colspan="2" class="textfieldalign" &gt;&amp;nbsp;&lt;/td&gt;
                                              &lt;/tr&gt;
                                              &lt;tr class="darkrow"&gt;
                                                  &lt;td width="30%" class="textalign"&gt;Department Name&lt;/td&gt;
                                                  &lt;td width="5%" class="mandatory"&gt;*&lt;/td&gt;
                                                  &lt;td width="65%" colspan="2" class="textfieldalign" &gt;&lt;input type="text" class="textbox" name="department" id="department" maxlength="20"  onblur="isDepartmentExist()"&gt;&lt;/td&gt;
                                              &lt;/tr&gt;
                                              &lt;tr class="lightrow"&gt;
                                                  &lt;td width="30%" class="textalign"&gt;&amp;nbsp;&lt;/td&gt;
                                                  &lt;td width="5%" class="mandatory"&gt;&amp;nbsp;&lt;/td&gt;
                                                  &lt;td width="65%" colspan="2" class="textfieldalign" &gt;&lt;input type="button" class="submitbu" name="save" id="save" value="Save" onclick="saveDepartment()"&gt;
                                                      &lt;input type="button" class="submitbu" name="exit" id="exit" value="Exit" onclick="cancelAddDepartment();"&gt;&lt;/td&gt;
                                              &lt;/tr&gt;
                                          &lt;/table&gt;
                                      &lt;/td&gt;
                                  &lt;/tr&gt;
                              &lt;/table&gt;
                          &lt;/div&gt;
                          &lt;div class="screenBody" id=""&gt;
                              &lt;div class="listArea"&gt;
                                  &lt;div class="searchArea"&gt;
                                      &lt;table cellspacing="0" cellspacing="0"&gt;
                                          &lt;tbody&gt;
                                              &lt;tr&gt;
                                                  &lt;td&gt;
                                                      &lt;label&gt;Department Name&lt;/label&gt;
                                                      &lt;input type="text" name="departmentName" id="departmentName" size="50" maxlength="245"  onfocus="new Autocompleter.DWR('departmnet','departmentNameList',updateList,{ valueSelector: nameValueSelector });"&gt;
                                                      &lt;img id="INST_ID_LOADER" style="display:none;" src="&lt;%=resourcePath%&gt;/images/loading_3.gif" align="middle" border="0"&gt;
                                                      &lt;div id="departmentNameList" class="auto_complete"&gt;&lt;/div&gt;
                                                  &lt;/td&gt;
                                                  &lt;td&gt;
                                                      &lt;div class="commonButton" id="bid-search"&gt;
                                                          &lt;input type="button" name="bname_search" class="submitbu" value="Search" onclick="getDepartmentData()"&gt;
                                                      &lt;/div&gt;
                                                  &lt;/td&gt;
                                              &lt;/tr&gt;
                                          &lt;/tbody&gt;
                                      &lt;/table&gt;
                                  &lt;/div&gt;
                                  &lt;form method="post" autocomplete="off" id="mainform"&gt;
                                      &lt;div class="report-heading" &gt;
                                          &lt;div align="right"&gt;
                                              &lt;a href='#' onclick="addDepartment()"&gt;Add Department&lt;/a&gt;
                                              &lt;label&gt;Export to:&lt;/label&gt;
                                              &lt;select&gt;
                                                  &lt;option value=""&gt;Excel&lt;/option&gt;
                                                  &lt;option value=""&gt;CSV&lt;/option&gt;
                                                  &lt;option value=""&gt;PDF&lt;/option&gt;
                                              &lt;/select&gt;
                                              &lt;input type="button" class="submitbu" value="Export" /&gt;
                                              &lt;input type="hidden" id="method" name="method" /&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                      &lt;div class="gridArea"&gt;
                                          &lt;div id="departmentList"&gt;&lt;/div&gt;
                                      &lt;/div&gt;
                                      &lt;input type="hidden" name="total" id="total" value="40" /&gt;
                                      &lt;input type="hidden" name="rec_per_page" id="rec_per_page" value="10" /&gt;
                                  &lt;/form&gt;
                                  &lt;div id="paginator"&gt;&lt;/div&gt;&lt;!-- for paginator --&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/tbody&gt;
          &lt;/table&gt;
          &lt;div class="LeftFrameSwitcher" id="divLeftFrameSwitcher"&gt;
              &lt;img alt="bar_close.gif" title="Hide/show the navigation pane" id="imgLeftFrameSwitcher" onclick="SwitchLeftFrame();" src="&lt;%=resourcePath%&gt;/data-page/bar_close.gif" height="60" width="8"&gt;
          &lt;/div&gt;
          &lt;input type="hidden" name="method" &gt;
      &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>Please help me,</p>