MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » Struts2.0警告: Could not find action or result解

Struts2.0警告: Could not find action or result解决办法(2)

www.MyException.Cn  网友分享于:2013-01-20  浏览:718次

There is no Action mapped for namespace / and action name . - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:177)
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:47)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)






<?xml version="1.0" encoding="GBK"?>
<!DOCTYPE struts PUBLIC
  "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
  "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
  <package name="lee" extends="struts-default">
  <action name="login" class="lee.LoginAction">
   
  <result name="success">/welcome.jsp</result>  
  <result name="error">/error.jsp</result>
  </action>
  </package>
</struts>



<%@ page language="java" contentType="text/html; charset=GBK"%>
<html>
<head>
<title>登录页面</title>
</head>
<body>
<form action="login" method="post">
  <table align="center">
  <caption><h3>用户登录</h3></caption>
  <tr>
  <td>用户名:<input type="text" name="username"/></td>
  </tr>
  <tr>
  <td>密&nbsp;&nbsp;码:<input type="text" name="password"/></td>
  </tr>
  <tr align="center">
  <td><input type="submit" value="登录"/><input type="reset" value="重填" /></td>
  </tr>
  </table>
</form>
</body>
</html>


------解决方案--------------------
action有错,默认返回input
但是你没配input
------解决方案--------------------

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有