Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏

第 94 章 Apache Struts

目录

94.1. struts.xml
94.1.1. include
94.2. Struts Tags
94.2.1. property
94.2.2. set
94.2.3. url
94.2.4. s:include
94.2.5. s:action
94.2.6. HTML Form
94.2.7. iterator
94.2.8. if elseif else
94.3. Action
94.3.1. redirect
94.3.2. redirectAction
94.3.3. JSON
94.3.4. 传递 Timestamp 变量
94.4. Ajax + JSON
94.4.1. GET/POST JSON
94.5. Json 内容展示
94.5.1. 禁止方法
94.5.2. 格式化日期
94.5.3. 重命名变量名
94.5.4. org.apache.struts2.json
94.6. Interceptor
94.6.1. Session
94.7. Action 中使用线程
94.8. 日志
94.9. FAQ
94.9.1. Struts 怎样判断用户来自电脑还是移动设备

http://struts.apache.org/

You can checkout all the example applications from the Struts 2 GitHub repository at https://github.com/apache/struts-examples.

94.1. struts.xml

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"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
	id="WebApp_ID" version="3.0">
	<display-name>helloworld</display-name>
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.htm</welcome-file>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>default.html</welcome-file>
		<welcome-file>default.htm</welcome-file>
		<welcome-file>default.jsp</welcome-file>
	</welcome-file-list>

	<filter>
		<filter-name>struts2</filter-name>
		<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
	</filter>

	<filter-mapping>
		<filter-name>struts2</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

</web-app>		
		
		

94.1.1. include

			
	<include file="/cn/netkiller/struts/ajax.xml" />
	<include file="/cn/netkiller/struts/admin.xml" />	
	<include file="/cn/netkiller/struts/logs.xml" />