java.lang.NoSuchMethodException: Action[/login] does not contain 求助
严重: Servlet.service() for servlet action threw exceptionjava.lang.NoSuchMethodException: Action[/login] does not contain specified method (check logs)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:264)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.listener.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:26)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)
--------------------编程问答-------------------- config-xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<data-sources />
<form-beans>
<form-bean name="Gasuser" type="com.pojo.Gasuser"></form-bean>
<form-bean name="file1" type="form.FileForm" />
</form-beans>
<global-exceptions />
<global-forwards />
<action-mappings>
<action
attribute="fileForm"
input="/addUser.jsp"
name="file1"
path="/file"
type="action.FileAction"
validate="false">
<forward name="success" path="/admin/addUser.jsp"></forward>
</action>
<action
attribute="fileForm"
input="/export.jsp"
name="file1"
path="/filedetail"
type="action.FileUserAction"
validate="false">
<forward name="success" path="/admin/export.jsp"></forward>
</action>
<action path="/login" parameter="method" name="Gasuser">
<forward name="login" path="/login.jsp"></forward>
<forward name="unitLogin" path="/index.jsp"></forward>
<forward name="main" path="/service/main.jsp"></forward>
<forward name="unitMain" path="/unit/main.jsp"></forward>
<forward name="selectMain" path="/selectGasuser/main.jsp"></forward>
<forward name="deliverMain" path="/deliverGas/main.jsp"></forward>
<forward name="changeMain" path="/changeWatch/main.jsp"></forward>
<forward name="complainMain" path="/complain/main.jsp"></forward>
<forward name="leaderMain" path="/leader/main.jsp"></forward>
<forward name="chargeMain" path="/charge/main.jsp"></forward>
<forward name="controlMain" path="/control/main.jsp"></forward>
<forward name="user" path="/admin/user.jsp"></forward>
<forward name="update" path="/admin/updatePass.jsp"></forward>
<forward name="service" path="/admin/service.jsp"></forward>
<forward name="addService" path="/login.do?method=getUsers"></forward>
<forward name="manage" path="/admin/serviceManage.jsp"></forward>
<forward name="add" path="/admin/addUser.jsp"></forward>
<forward name="addUser" path="/login.do?method=getUserCondition"></forward>
<forward name="wxService" path="/login.do?method=getServiceById"></forward>
<forward name="dispatch" path="/admin/dispatching.jsp"></forward>
<forward name="finish" path="/admin/finish.jsp"></forward>
<forward name="collect" path="/admin/collect.jsp"></forward>
<forward name="addOperator" path="/admin/addOperator.jsp"></forward>
<forward name="addRepairor" path="/admin/addRepairor.jsp"></forward>
<forward name="addWxunit" path="/admin/addWxunit.jsp"></forward>
<forward name="updateUser" path="/admin/updateUser.jsp"></forward>
<forward name="userInfo" path="/admin/userInfo.jsp"></forward>
<forward name="serviceInfo" path="/admin/serviceInfo.jsp"></forward>
<forward name="print" path="/admin/dispathPrint.jsp"></forward>
<forward name="newUserinfo" path="/admin/newUserInfo.jsp"></forward>
<forward name="newUser" path="/admin/newUser.jsp"></forward>
<forward name="check" path="/admin/check.jsp"></forward>
<forward name="noGasuser" path="/admin/noGasuser.jsp"></forward>
<forward name="aerate" path="/login.do?method=getUserByWait"></forward>
<forward name="unAerate" path="/admin/unAerate.jsp"></forward>
<forward name="newUserTable" path="/admin/newUserTable.jsp"></forward>
<forward name="table" path="/admin/table.jsp"></forward>
<forward name="checkUserTable" path="/admin/checkUserTable.jsp"></forward>
<forward name="wxServiceTable" path="/admin/wxServiceTable.jsp"></forward>
<forward name="serviceBusiness" path="/admin/serviceBusiness.jsp"></forward>
<forward name="serviceWeek" path="/admin/serviceWeekTable.jsp"></forward>
<forward name="serviceCause" path="/admin/serviceCauseTable.jsp"></forward>
<forward name="complain" path="/login.do?method=getWxComplains"></forward>
<forward name="wxComplain" path="/admin/wxComplain.jsp"></forward>
<forward name="noProcedure" path="/admin/noProcedure.jsp"></forward>
<forward name="manageProcedure" path="/admin/manageProcedure.jsp"></forward>
<forward name="selectProcedure" path="/login.do?method=getUserByNoProcedure"></forward>
<forward name="waitUser" path="/admin/waitUser.jsp"></forward>
<forward name="selectWait" path="/login.do?method=getUserByNoGas"></forward>
<forward name="forceUser" path="/admin/forceUser.jsp"></forward>
<forward name="selectForce" path="/login.do?method=getUserByForce"></forward>
<forward name="concert" path="/admin/concert.jsp"></forward>
<forward name="noUseDateTable" path="/admin/noUseDateTable.jsp"></forward>
<forward name="deliveTable" path="/admin/deliveGasTable.jsp"></forward>
<forward name="gasdetailTable" path="/admin/gasdetailTable.jsp"></forward>
<forward name="procedureTable" path="/admin/procedureTable.jsp"></forward>
<forward name="addDevelop" path="/admin/addDevelop.jsp"></forward>
<forward name="developManage" path="/admin/developManage.jsp"></forward>
<forward name="develop" path="/login.do?method=getDevelopTowns"></forward>
<forward name="developInfo" path="/admin/developInfo.jsp"></forward>
<forward name="townManage" path="/login.do?method=getTownInformation"></forward>
<forward name="townInformation" path="/admin/townInformation.jsp"></forward>
<forward name="concertManage" path="/admin/concertManage.jsp"></forward>
<forward name="concerts" path="/login.do?method=getUsersByConcert"></forward>
<forward name="concertInfo" path="/admin/concertInfo.jsp"></forward>
<forward name="complainInfo" path="/admin/complainInfo.jsp"></forward>
<forward name="developUnit" path="/admin/develop.jsp"></forward>
<forward name="addDevelop" path="/admin/addDevelop.jsp"></forward>
<forward name="addVillage" path="/admin/addVillage.jsp"></forward>
<forward name="addBook" path="/admin/addBook.jsp"></forward>
<forward name="book" path="/login.do?method=getVillageByCasher"></forward>
<forward name="villageInfo" path="/admin/villageInfo.jsp"></forward>
<forward name="urgency" path="/admin/urgency.jsp"></forward>
<forward name="urgencyManage" path="/login.do?method=getWxServiceByUrgency"></forward>
<forward name="addProject" path="/admin/project.jsp"></forward>
<forward name="updateProject" path="/admin/updateProject.jsp"></forward>
<forward name="updateCheck" path="/admin/updateCheck.jsp"></forward>
<forward name="ctobManage" path="/manage/ctobManage.jsp"></forward>
<forward name="btocManage" path="/manage/btocManage.jsp"></forward>
<forward name="changeManage" path="/manage/changeManage.jsp"></forward>
<forward name="deleteManage" path="/manage/deleteManage.jsp"></forward>
<forward name="quitManage" path="/manage/quitManage.jsp"></forward>
<forward name="userDetail" path="/admin/userDetail.jsp"></forward>
<forward name="addFloor" path="/admin/addFloor.jsp"></forward>
<forward name="floor" path="/login.do?method=getTownByFloor"></forward>
<forward name="floorManage" path="/admin/FloorManage.jsp"></forward>
<forward name="floorByBook" path="/login.do?method=getFloorByBook"></forward>
<forward name="diary" path="/admin/diary.jsp"></forward>
<forward name="addPraise" path="/admin/addPraise.jsp"></forward>
<forward name="praiseManage" path="/admin/praiseManage.jsp"></forward>
<forward name="rate" path="/admin/rate.jsp"></forward>
<forward name="fenpeiBook" path="/admin/fenpeiBook.jsp"></forward>
<forward name="addDetail" path="/admin/addDetail.jsp"></forward>
<forward name="export" path="/admin/export.jsp"></forward>
<forward name="sfInformation" path="/admin/sfInformation.jsp"></forward>
<forward name="addInformation" path="/admin/addInformation.jsp"></forward>
<forward name="Information" path="/admin/Information.jsp"></forward>
<forward name="handService" path="/admin/handService.jsp"></forward>
<forward name="getWait" path="/login.do?method=getWait"></forward>
<forward name="getNoGas" path="/login.do?method=getNoGas"></forward>
<forward name="getVillage" path="/login.do?method=getVillage"></forward>
<forward name="getTongzhi" path="/login.do?method=getTongzhi"></forward>
<forward name="getService" path="/login.do?method=getService"></forward>
<forward name="getHuifang" path="/login.do?method=getHuifang"></forward>
</action>
</action-mappings>
<controller
processorClass="org.springframework.web.struts.DelegatingRequestProcessor">
</controller>
<message-resources
parameter="com.yourcompany.struts.ApplicationResources" />
<plug-in
className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="WEB-INF/applicationContext.xml" />
</plug-in>
</struts-config>
action中方法
public ActionForward getHuifang(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws IOException {
TabOperator operator = (TabOperator) request.getSession().getAttribute(
"operator");
WxService service = new WxService();
String op = operator.getType();
List list = serviceService.getWxService2(service,op);
System.out.println("aaaa");
JSONArray jsonArray2 = JSONArray.fromObject(list);
response.setCharacterEncoding("gb2312");
response.getWriter().print(jsonArray2.toString());
return mapping.findForward("");
}
大家给看看 怎么回事啊 我没什么分数 请大家帮帮忙 --------------------编程问答-------------------- 调用ACTION所对应的方法不存在。。或者你调用的路径不正确。 --------------------编程问答-------------------- java.lang.NoSuchMethodException: Action[/login] does not contain specified method (check logs)
看看 /login这个Action中,有方法没有找到 :Action[/login]没有包含指定的方法 --------------------编程问答-------------------- action里没有指定的方法,方法名写错了。。。
补充:Java , Web 开发