HTTP Status 404 - There is no Action mapped for namespace [/] and action name [LoginAction] associ
HTTPStatus404-ThereisnoActionmappedfornamespace[/]andactionname[LoginAction]associate...
HTTP Status 404 - There is no Action mapped for namespace [/] and action name [LoginAction] associated with context path [/Action].
求帮忙看一下。
<--!strutsbegin
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<!-- Add packages here -->
<!-- 开发模式开启设置value为true -->
<constant name="struts.devMode" value="true" />
<!-- package相当与JAVA中的包,用于区分名称的重名带来的麻烦 namespace默认为空 -->
<package name="actions" extends="struts-default" namespace="/">
<action name="LoginAction" class="struts2.LoginAction">
<result name="SUCCESS">
/login.jsp
</result>
</action>
</package>
</struts>
-->strutsend
//调用User实体类传值
package struts2;
import com.opensymphony.xwork2.ActionSupport;
import entity.Users;
public class LoginAction extends ActionSupport {
private Users user;
@Override
public String execute() throws Exception {
System.out.println(user.getName());
return SUCCESS;
}
public Users getUser() {
return user;
}
public void setUser(Users user) {
this.user = user;
}
}
//以下是以前老的JSP的action改成了struts的名称
......
<form action="LoginAction" method="post">
..... 展开
求帮忙看一下。
<--!strutsbegin
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<!-- Add packages here -->
<!-- 开发模式开启设置value为true -->
<constant name="struts.devMode" value="true" />
<!-- package相当与JAVA中的包,用于区分名称的重名带来的麻烦 namespace默认为空 -->
<package name="actions" extends="struts-default" namespace="/">
<action name="LoginAction" class="struts2.LoginAction">
<result name="SUCCESS">
/login.jsp
</result>
</action>
</package>
</struts>
-->strutsend
//调用User实体类传值
package struts2;
import com.opensymphony.xwork2.ActionSupport;
import entity.Users;
public class LoginAction extends ActionSupport {
private Users user;
@Override
public String execute() throws Exception {
System.out.println(user.getName());
return SUCCESS;
}
public Users getUser() {
return user;
}
public void setUser(Users user) {
this.user = user;
}
}
//以下是以前老的JSP的action改成了struts的名称
......
<form action="LoginAction" method="post">
..... 展开
1个回答
2013-06-07
展开全部
<form action="/LoginAction" method="post">
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询