struts 报错 No action config found for the specified url
Posted Kikyo
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了struts 报错 No action config found for the specified url相关的知识,希望对你有一定的参考价值。
1
type Exception report
message org.apache.struts.chain.commands.InvalidPathException: No action config found for the specified url.
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: org.apache.struts.chain.commands.InvalidPathException: No action config found for the specified url.
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
k.filter.EncodingFilter.doFilter(EncodingFilter.java:14)
root cause
org.apache.struts.chain.commands.InvalidPathException: No action config found for the specified url.
org.apache.struts.chain.commands.AbstractSelectAction.execute(AbstractSelectAction.java:71)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
k.filter.EncodingFilter.doFilter(EncodingFilter.java:14)
note The full stack trace of the root cause is available in the Apache Tomcat/8.0.35 logs.
原因:
struts-config.xml里面的 path 是 区 分 大 小 写 !!!
过程
<action name="userForm" path="/login" parameter="action" type="k.action.LoginAction" scope="request" attribute="userForm" input="index.jsp" validate="false"> <forward name="ok" path="/WEB-INF/jsp/ok.jsp"></forward> <forward name="err" path="/WEB-INF/jsp/err.jsp"></forward> <forward name="login" path="/WEB-INF/jsp/login.jsp"></forward> </action>
<form action="${APP_PATH}/Login.do?action=doUserLogin" method="post"> 账号:<input type="text" name="userName" value="11哈哈"> <br> 密码: <input type="password" name="password" value="1"> <br> <input type="submit" value="submit"> <br> </form>
form的path Login 大写了
以上是关于struts 报错 No action config found for the specified url的主要内容,如果未能解决你的问题,请参考以下文章
No result defined for action com.action.Actionxxx and result xxx
问题管理-- Struts2配置struts.xml中Action访问报There is no Action mapped for namespace...
struts异常:No result defined for action
Struts2异常:HTTP Status 404 - There is no Action mapped for action name addBook.