急急急!struts2报404错误!所有分都送上!
现在在做一个项目,配置环境:tomcat6.0.35 + JDK1.6.0_30 + struts2.3.1.2 + mysql5.0
但是form提交的时候,报404错误.
进入index.jsp提交后,报错“HTTP Status 404 - /huazhaosoft/manager.do”
type Status report
message /huazhaosoft/manager.do
description The requested resource (/huazhaosoft/manager.do) is not available.
index.jsp
<form name="form1" method="post" action="manager.do?action=login">
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>SSH</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
struts.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.action.extension" value="do" />
<constant name="struts.devMode" value="true" />
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<package name="package" extends="struts-default" namespace="/huazhaosoft">
<action name="managerForm" path="/manager" scope="request" type="com.action.Manager" validate="true">
<forward name="managerLoginok" path="/welcome.jsp" />
<forward name="error" path="/welcome.jsp" />
</action>
</package>
</struts>
manager.java
package com.action;
import org.apache.struts.action.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.actionForm.ManagerForm;
import com.dao.ManagerDAO;
import javax.servlet.http.HttpSession;
public class Manager extends Action {
private ManagerDAO managerDAO = null;
public Manager() {
this.managerDAO = new ManagerDAO();
}
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
String action = request.getParameter("action");
System.out.println("获取的查询字符串:" + action);
if (action == null || "".equals(action)) {
return mapping.findForward("error");