努力GOGO
2016-01-02 17:20
出现这样错误
HTTP Status 404 - There is no Action mapped for namespace / and action name LoginAction.
type Status report
message There is no Action mapped for namespace / and action name LoginAction.
description The requested resource (There is no Action mapped for namespace / and action name LoginAction.) is not available.
代码:
<form action="LoginAction.action" method="post">
用户名:<input type="text" name="username">
密码:<input type="password" name="password">
<input type="submit" value="提交"/>
</form>
<package name="default" extends="struts-default">
<action name="LoginAction" method="login" class="com.xaccp.Action.LoginAction">
<result>/success.jsp</result>
</action>
</package>
public class LoginAction extends ActionSupport {
private String username;
private String password;
public String login(){
System.out.println(username);
return SUCCESS;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
求解
<form action="LoginAction.action" method="post">是这里action后的路径写错了吧
谢谢大家,我找出来了 没写<include file="helloworld.xml"></include>这句话
警告: Could not find action or result
There is no Action mapped for namespace / and action name LoginAction. - [unknown location]
Struts2入门
95062 学习 · 456 问题
相似问题