标签:
一 struts(jar+web.xml+struts.xml+Action)
1import min_jars-------struts-2.3.20.3-all(struts2-blank.war)+mysql-connector+jsp-api+servlet-api
2web.xml---------------<filter>struts2 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
<?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_3_0.xsd" id="WebApp_ID" version="3.0">
3struts.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<!-- START SNIPPET: xworkSample -->
<struts>
<package name="struts" extends="struts-default">
<action name="findEmployee" class="com.huawei.Imost.sms.employee.action.EmployeeAction" method="execute">
<result name="success">/WEB-INF/jsp/employee/employee.jsp</result>
<result name="other">/WEB-INF/jsp/other/other.jsp</result>
<result name="none">/WEB-INF/jsp/error/error200.jsp</result>
</action>
</package>
</struts>
4.自定义Action extends ActionSupport
标签:
原文地址:http://www.cnblogs.com/mustang51/p/5458954.html