請問,這錯(cuò)誤找不到了
出現(xiàn)這樣錯(cuò)誤
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;
}
}
求解
2016-01-02
<form action="LoginAction.action" method="post">是這里action后的路徑寫錯(cuò)了吧
2016-01-02
謝謝大家,我找出來了 沒寫<include file="helloworld.xml"></include>這句話
2016-01-02
警告: Could not find action or result
There is no Action mapped for namespace / and action name LoginAction. - [unknown location]