日期:2014-05-17  浏览次数:20590 次

第一个struts2小程序就出现404错误?
Struts.xml 配置文件如下:
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd"
>
<sttuts>
<package name="struts" namespace="/" extends="struts_default">
<action name="login" class="LoginAction">
<result name="error">/error.jsp</result>
<result name="success">/welcome.jsp</result>
</action>
</package>
</sttuts>


web.xml配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 
xmlns="http://java.sun.com/xml/ns/javaee" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
  <filter>
  <filter-name>struts2</filter-name>
  <filter-class>
  org.apache.struts2.dispatcher.FilterDispatcher
  </filter-class>
  </filter>
  <filter-mapping>
  <filter-name>struts2</filter-name>
  <url-pattern>/*</url-pattern>
  </filter-mapping>
</web-app>


tomcat 配置没问题,其他工程在此环境下运行没有问题!
可以正常运行!

------解决方案--------------------
异常呢
------解决方案--------------------
struts/login.action
------解决方案--------------------
404错误有项目没有部署
地址栏输入地址错误
目录不能被引用


------解决方案--------------------
struts_default
改成struts-default试试