*********来看看:Struts2的HelloWorld 怎么都不能运行,高手帮忙 ***************
写了一个Struts2的HelloWorld 怎么都不能运行,高手帮忙看看?多谢。
文件的结构:
---Hello
--index.html
--WEB-INF
--web.xml
--lib(struts2所有的jar)
--classes
--struts.xml
index.html里面就一个HelloWorld,
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>
<include file="struts-default.xml"/>
</struts>
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_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>Hello</display-name>
<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>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
运行 localhost:8000/Hello/index.html
或者运行 运行 localhost:8000/Hello/
都说 HTTP Status 404 - /Hello/index.html 删掉web.xml就正常,请高手看看哪里出错了。
多谢多谢!!