彻底解决STRUTS2 错误There is no Action mapped for namespace / and action name login
2009-07-10 09:51
501 查看
前几天在网上下载一个struts2的helloword的例子,那个作者也真够缺德的,搞个错误的程序,害得我查了一天的程序错误。
最后发现竟然是struts.xml被写成啦sturts.xml。
碰见这样的问题先鄙视下提供例子的作者,
再声讨下struts2,为什么要在框架里面加载一个死的struts.xml,难得不能想struts1 一样的在web.xml里面配置吗?
看网上都催struts2比struts1 整的整的好,我看就这个问题,完全可以算struts2是个垃圾
我现在把完整的程序提供给大家,希望大家看看.
好像上传不了附件,我贴源代码吧
package tutorial;
/**
* @Description: helloword例子
* @author warison
* @qq 274843301
* @date: Mar 19, 2009
* @verison 1.0
* @modify Mar 19, 2009
**/
import com.opensymphony.xwork2.ActionSupport;
public class HelloWorld extends ActionSupport {
/**
*
*/
private static final long serialVersionUID = 1L;
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String execute() {
name = "Hello, " + name + "!";
return SUCCESS;
}
}
jsp:
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Say Hello</title>
</head>
<body>
<h3>Say "Hello" to: </h3>
<s:form action="hld">
Name: <s:textfield name="name" />
<s:submit />
</s:form>
</body>
</html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Hello</title>
</head>
<body>
<h3><s:property value="name" /></h3>
</body>
</html>
struts.xml配置文件
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="tutorial" extends="struts-default">
<action name="hld" class="tutorial.HelloWorld">
<result>/HelloWorld.jsp</result>
</action>
</package>
</struts>
最后发现竟然是struts.xml被写成啦sturts.xml。
碰见这样的问题先鄙视下提供例子的作者,
再声讨下struts2,为什么要在框架里面加载一个死的struts.xml,难得不能想struts1 一样的在web.xml里面配置吗?
看网上都催struts2比struts1 整的整的好,我看就这个问题,完全可以算struts2是个垃圾
我现在把完整的程序提供给大家,希望大家看看.
好像上传不了附件,我贴源代码吧
package tutorial;
/**
* @Description: helloword例子
* @author warison
* @qq 274843301
* @date: Mar 19, 2009
* @verison 1.0
* @modify Mar 19, 2009
**/
import com.opensymphony.xwork2.ActionSupport;
public class HelloWorld extends ActionSupport {
/**
*
*/
private static final long serialVersionUID = 1L;
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String execute() {
name = "Hello, " + name + "!";
return SUCCESS;
}
}
jsp:
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Say Hello</title>
</head>
<body>
<h3>Say "Hello" to: </h3>
<s:form action="hld">
Name: <s:textfield name="name" />
<s:submit />
</s:form>
</body>
</html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Hello</title>
</head>
<body>
<h3><s:property value="name" /></h3>
</body>
</html>
struts.xml配置文件
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="tutorial" extends="struts-default">
<action name="hld" class="tutorial.HelloWorld">
<result>/HelloWorld.jsp</result>
</action>
</package>
</struts>
相关文章推荐
- Struts应用出现的错误及解决方法:There is no Action mapped for namespace / and action name login
- Struts2中关于"There is no Action mapped for namespace / and action name"的错误解决
- 关于struts2总是报There is no Action mapped for namespace / and action name login错误的一点经验
- 解决STRUTS2 错误 There is no Action mapped for namespace / and action name
- struts2常见配置解决错误There is no mapped for namespace[/] and action name
- ssh web项目出现错误There is no Action mapped for namespace [/] and action name [login] associate解决办法
- Struts2中关于"There is no Action mapped for namespace / and action name"错误
- struts2关于"There is no Action mapped for namespace / and action name"的解决方法
- 关于Struts2中的错误:例如There is no Action mapped for namespace / and action name product-input.
- There is no Action mapped for namespace / and action name login.的解决
- struts2中错误提示:There is no Action mapped for namespace / and action name
- struts2提示“There is no Action mapped for namespace [/] and action name [XXX]... ”错误的解决办法
- 解决Struts2报"There is no Action mapped for namespace / and action name"错误
- Struts错误:There is no Action mapped for namespace / and action name
- Struts2中"There is no Action mapped for namespace / and action name"
- There is no Action mapped for namespace / and action name . - [unknown location] 其中一种解决方法
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结 (转载)
- There is no Action mapped for namespace [/] and action name [login] associate解决办法 .