<web-app id="WebApp_9" version="2.4" xmlns="[url]http://java.sun.com/xml/ns/j2ee[/url]" xmlns:xsi="[url]http://www.w3.org/2001/XMLSchema-instance[/url]" xsi:schemaLocation="[url]http://java.sun.com/xml/ns/j2ee[/url] [url]http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd[/url]">
<display-name>Hello World</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"[url]http://struts.apache.org/dtds/struts-2.0.dtd[/url]">
<struts><!-- Configuration for the default package. -->
<package name="default" extends="struts-default">
<action name="HelloWorld" class="HelloWorld">
<result name="success">/helloworld.jsp</result>
</action>
</package>
</struts>
private String message;
public String execute() throws Exception {
return this.SUCCESS;
}
public void setMessage(String message){
this.message = message;
}
public String getMessage() {
return message;
}
}
pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/url]">
<html xmlns="[url]http://www.w3.org/1999/xhtml[/url]">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>首页</title>
</head>
<body>
<h2><s:form action="HelloWorld">
<s:textfield name="message" label="你的姓名"></s:textfield>
<s:submit value="提交"></s:submit>
</s:form></h2>
</body>
</html>
pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/url]">
<html xmlns="[url]http://www.w3.org/1999/xhtml[/url]">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Hello World</title>
</head>
<body>
你好:<s:property value="message" />!
</body>
</html>
2007-11-4 23:13:21 org.apache.catalina.core.StandardContext start
严重: Context startup failed due to previous errors
2007-11-4 23:13:24 org.apache.catalina.core.StandardHost getDeployer