struts2.0基础配置问题
最近开始学习struts2.0.
在配置的时候发生一些问题。
我的例程主要有:login.jsp;result.jsp;web.xml;struts.xml;LoginAction;
运行过程中发生这个问题:
HTTP Status 404 - /struts/WebRoot/login.action
--------------------------------------------------------------------------------
type Status report
message /struts/WebRoot/login.action
description The requested resource (/struts/WebRoot/login.action) is not available.
login.jsp的主要代码是:
<form action="login.action" method = "post">
用户名:<input type="text" name="username"><br>
密 码:<input type="password" name="password"><br>
<input type="submit" value="提交">
</form>
web.xml的主要代码是:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
struts.xml的主要配置是:
<struts>
<package name="struts2" extends="struts-default">
<action name="login" class="com.test.action.LoginAction">
<result>/result.jsp</result>
</action>
</package>
</struts>
LoginAction.java的主要代码
package com.test.action;
public class LoginAction {
private String username;
private String password;
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;
}
public String execute () throws Exception{
return "success";
}
}
请高手帮忙找找问题发生在那呀!!!!!!!!