用Struts写一个action出现下面的错误
严重: Could not execute action: /doctor/waitOrderList
There is no Action mapped for namespace /doctor and action name waitOrderList. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189)
at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
at org.apache.struts2.components.ActionComponent.executeAction(ActionComponent.java:287)
at org.apache.struts2.components.ActionComponent.end(ActionComponent.java:173)
at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
at org.apache.jsp.doctor.index_jsp._jspx_meth_s_005faction_005f0(index_jsp.java:606)
at org.apache.jsp.doctor.index_jsp._jspx_meth_s_005felse_005f0(index_jsp.java:420)
at org.apache.jsp.doctor.index_jsp._jspService(index_jsp.java:209)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:88)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
一月 01, 2018 10:07:01 下午 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
Action:WaitOrderAction 方法如下
//医生查看未完成的预约
public String execute() throws Exception {
HttpServletRequest request = ServletActionContext.getRequest();
HttpSession session = request.getSession();
Doctorinfo doc = (Doctorinfo) session.getAttribute("info");
DoctorDAO doctor = new DoctorDAO();
Doctorinfo result = doctor.getDoctorByID(doc.getDoctorId());
if(result == null){
this.setMessage("该账号已停用,请联系管理员");
return SUCCESS;
}
orderDao = new OrderListInfoDAO();
int size= orderDao.listOrderSizeByDoctorName(doc.getDoctorName(), 1);
List list = orderDao.listOrderByDoctorName(doc.getDoctorName(), pageNow, pageSize,1);
//System.out.println(size);
//System.out.println("未完成订单:"+size);
Pager page = new Pager(pageNow, size);
request.setAttribute("list",list);
request.setAttribute("page", page);
return SUCCESS;
}
Struts.xml为:
/doctor/waitOrder.jsp
页面调用为:(页面保存在WebRoot/doctor/index.jsp 内)
设计结构为:
为啥调用的时候会报这个错呢 找了好几个解决方案都不行 大家能帮忙看看吗