怎么弄都是404错误 实在看不出来哪有问题了…… 高手帮忙……
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<display-name>HelloApp Struts Application</display-name> <servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping> <welcome-file-list>
<welcome-file>hello.jsp</welcome-file>
</welcome-file-list> <taglib>
<taglib-url>/WEB-INF/struts-bean.tld</taglib-url>
<taglib-loacation>/WEB-INF/Struts-bean.tld</taglib-location>
</taglib> <taglib>
<taglib-url>/WEB-INF/struts-html.tld</taglib-url>
<taglib-location>/WEB-INF/Struts-html.tld</taglib-location>
</taglib> <taglib>
<taglib-url>/WEB-INF/struts-logic.tld</taglib-url>
<taglib-location>/WEB-INF/Struts-logic.tld</taglib-location>
</taglib>
</web-app>struts-config.xml:<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
"http://struts.apache.org/dtds/struts-config_1_2.dtd"><struts-config>
<form-beans>
<form-bean name="HelloForm" type="hello.HelloForm"/>
</form-beans> <action-mappings>
<action path = "/HelloWorld"
type = "hello.HelloAction"
name = "HelloForm"
scope = "request"
validate = "true"
input = "/hello.jsp"
>
<forward name = "SayHello" path = "/hello.jsp"/>
</action>
</action-mappings>
<message-resources parameter = "hello.application"/>
</struts-config>
hello.jsp:<%@ page contentType="text/html;charset=utf-8" language = "java"%>
<%@ taglib url="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib url="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib url="/WEB-INF/struts-logic.tld" prefix="logic" %><html:html locale="true">
<head>
<title><bean:message key="hello.jsp.title"/></title>
<html:base/>
</head><body bgcolor="white"><p>
<h2><bean:message key="hello.jsp.page.heading"/></h2><p>
<html:errors/><p><logic:present name="personbean" scope="request">
<h2>
<bean:message key="hello.jsp.page.hello"/>
<bean:write name="personbean" property="userName"/>!<p>
</h2>
</logic:present><html:form action="/HelloWorld.do" focus="userName">
<bean:message key="hello.jsp.prompt.person"/>
<html:text property="userName" size="16" maxlength="16"/><br>
<html:submit property="submit" value="Submit"/>
<html:reset/></html:form><br>
</body>
</html:html>
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<display-name>HelloApp Struts Application</display-name> <servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping> <welcome-file-list>
<welcome-file>hello.jsp</welcome-file>
</welcome-file-list> <taglib>
<taglib-url>/WEB-INF/struts-bean.tld</taglib-url>
<taglib-loacation>/WEB-INF/Struts-bean.tld</taglib-location>
</taglib> <taglib>
<taglib-url>/WEB-INF/struts-html.tld</taglib-url>
<taglib-location>/WEB-INF/Struts-html.tld</taglib-location>
</taglib> <taglib>
<taglib-url>/WEB-INF/struts-logic.tld</taglib-url>
<taglib-location>/WEB-INF/Struts-logic.tld</taglib-location>
</taglib>
</web-app>struts-config.xml:<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
"http://struts.apache.org/dtds/struts-config_1_2.dtd"><struts-config>
<form-beans>
<form-bean name="HelloForm" type="hello.HelloForm"/>
</form-beans> <action-mappings>
<action path = "/HelloWorld"
type = "hello.HelloAction"
name = "HelloForm"
scope = "request"
validate = "true"
input = "/hello.jsp"
>
<forward name = "SayHello" path = "/hello.jsp"/>
</action>
</action-mappings>
<message-resources parameter = "hello.application"/>
</struts-config>
hello.jsp:<%@ page contentType="text/html;charset=utf-8" language = "java"%>
<%@ taglib url="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib url="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib url="/WEB-INF/struts-logic.tld" prefix="logic" %><html:html locale="true">
<head>
<title><bean:message key="hello.jsp.title"/></title>
<html:base/>
</head><body bgcolor="white"><p>
<h2><bean:message key="hello.jsp.page.heading"/></h2><p>
<html:errors/><p><logic:present name="personbean" scope="request">
<h2>
<bean:message key="hello.jsp.page.hello"/>
<bean:write name="personbean" property="userName"/>!<p>
</h2>
</logic:present><html:form action="/HelloWorld.do" focus="userName">
<bean:message key="hello.jsp.prompt.person"/>
<html:text property="userName" size="16" maxlength="16"/><br>
<html:submit property="submit" value="Submit"/>
<html:reset/></html:form><br>
</body>
</html:html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货