初学struts,配置web.xml后,tomcate无法正常启动。急求高手
以下是我的struts-config.xml文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 1.1//EN" "http://struts.apache.org/dtds/struts-config_1_1.dtd">
<struts-config>
<form-beans>
<form-bean name="helloWordActionForm" type="com.file.HelloWorldActionForm"/>
</form-beans>
<action-mappings>
<action path="/HelloWorldAction" type="com.file.HelloWorldAction"
name="helloWorldActionForm"
parameter="methode"
scope="request" validate="false">
<forward name="success" path="/WhoSayHelloWorld.jsp"/>
</action>
</action-mappings>
</struts-config>
以下为web.xml文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.5//EN"
"http://java.sun.com/dtd/web-app_2_5.dtd">
<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">
<servlet>
<servlet-name>UsernameServlet</servlet-name>
<servlet-class>com.servlet.UsernameServlet</servlet-class>
</servlet>
<!-- 制定一个servlet的必要元素 -->
<servlet>
<!-- 表示该servlet的名字以及具体对象的所在 -->
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<!-- 定义servlet的初始接收参数 -->
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<!-- 定义servlet被web服务器装载的装载优先级 -->
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>UsernameServlet</servlet-name>
<url-pattern>/UsernameServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
以下为tomcate启动时的错误提示:
信息: Deploying web application directory StrustLearn
2012-4-4 11:22:32 org.apache.catalina.startup.ContextConfig applicationWebConfig
严重: Parse error in application web.xml file at jndi:/localhost/StrustLearn/WEB-INF/web.xml
java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
at java.io.BufferedInputStream.read(BufferedInputStre