Struts2原理及簡單實例

參考鏈接:html

http://blog.csdn.net/laner0515/article/details/27692673/java

http://www.cnblogs.com/sobne/articles/5443114.htmlweb

1、Struts2原理spring

設計目標

 

    Struts設計的第一目標就是使MVC模式應用於web程序設計。在這兒MVC模式的好處就不在提了。apache

 

技術優點

 

    Struts2有兩方面的技術優點,一是全部的Struts2應用程序都是基於client/server HTTP交換協議,The Java Servlet API揭示了java Servlet只是Java API的一個很小子集,這樣咱們能夠在業務邏輯部分使用功能強大的Java語言進行程序設計。json

 

    二是提供了對MVC的一個清晰的實現,這一實現包含了不少參與對因此請求進行處理的關鍵組件,如:攔截器、OGNL表達式語言、堆棧。設計模式

 

 

 

    由於struts2有這樣目標,而且有這樣的優點,因此,這是咱們學習struts2的理由,下面,咱們在深刻剖析一下struts的工做原理。api

 

工做原理

 

    Suruts2的工做原理能夠用下面這張圖來描述,下面咱們分步驟介紹一下每一步的核心內容安全

一個請求在Struts2框架中的處理大概分爲如下幾個步驟 session

    一、客戶端初始化一個指向Servlet容器(例如Tomcat)的請求

    二、這個請求通過一系列的過濾器(Filter)(這些過濾器中有一個叫作ActionContextCleanUp的可選過濾器,這個過濾器對於Struts2和其餘框架的集成頗有幫助,例如:SiteMesh Plugin) 

    三、接着FilterDispatcher被調用,FilterDispatcher詢問ActionMapper來決定這個請是否須要調用某個Action 

       FilterDispatcher是控制器的核心,就是mvc中c控制層的核心。下面粗略的分析下我理解的FilterDispatcher工做流程和原理:FilterDispatcher進行初始化並啓用核心doFilter

 1 public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException ...{  
 2         HttpServletRequest request = (HttpServletRequest) req;  
 3         HttpServletResponse response = (HttpServletResponse) res;  
 4         ServletContext servletContext = filterConfig.getServletContext();  
 5         // 在這裏處理了HttpServletRequest和HttpServletResponse。  
 6         DispatcherUtils du = DispatcherUtils.getInstance();  
 7         du.prepare(request, response);//正如這個方法名字同樣進行locale、encoding以及特殊request parameters設置  
 8         try ...{  
 9             request = du.wrapRequest(request, servletContext);//對request進行包裝  
10         } catch (IOException e) ...{  
11             String message = "Could not wrap servlet request with MultipartRequestWrapper!";  
12             LOG.error(message, e);  
13             throw new ServletException(message, e);  
14         }  
15                 ActionMapperIF mapper = ActionMapperFactory.getMapper();//獲得action的mapper  
16         ActionMapping mapping = mapper.getMapping(request);// 獲得action 的 mapping  
17         if (mapping == null) ...{  
18             // there is no action in this request, should we look for a static resource?  
19             String resourcePath = RequestUtils.getServletPath(request);  
20             if ("".equals(resourcePath) && null != request.getPathInfo()) ...{  
21                 resourcePath = request.getPathInfo();  
22             }  
23             if ("true".equals(Configuration.get(WebWorkConstants.WEBWORK_SERVE_STATIC_CONTENT))   
24                     && resourcePath.startsWith("/webwork")) ...{  
25                 String name = resourcePath.substring("/webwork".length());  
26                 findStaticResource(name, response);  
27             } else ...{  
28                 // this is a normal request, let it pass through  
29                 chain.doFilter(request, response);  
30             }  
31             // WW did its job here  
32             return;  
33         }  
34         Object o = null;  
35         try ...{  
36             //setupContainer(request);  
37             o = beforeActionInvocation(request, servletContext);  
38 //整個框架最最核心的方法,下面分析  
39             du.serviceAction(request, response, servletContext, mapping);  
40         } finally ...{  
41             afterActionInvocation(request, servletContext, o);  
42             ActionContext.setContext(null);  
43         }  
44     }  
45 du.serviceAction(request, response, servletContext, mapping);  
46 //這個方法詢問ActionMapper是否須要調用某個Action來處理這個(request)請求,若是ActionMapper決定須要調用某個Action,FilterDispatcher把請求的處理交給ActionProxy  
47    
48 public void serviceAction(HttpServletRequest request, HttpServletResponse response, String namespace, String actionName, Map requestMap, Map parameterMap, Map sessionMap, Map applicationMap) ...{   
49         HashMap extraContext = createContextMap(requestMap, parameterMap, sessionMap, applicationMap, request, response, getServletConfig());  //實例化Map請求 ,詢問ActionMapper是否須要調用某個Action來處理這個(request)請求  
50         extraContext.put(SERVLET_DISPATCHER, this);   
51         OgnlValueStack stack = (OgnlValueStack) request.getAttribute(ServletActionContext.WEBWORK_VALUESTACK_KEY);   
52         if (stack != null) ...{   
53             extraContext.put(ActionContext.VALUE_STACK,new OgnlValueStack(stack));   
54         }   
55         try ...{   
56             ActionProxy proxy = ActionProxyFactory.getFactory().createActionProxy(namespace, actionName, extraContext);   
57 //這裏actionName是經過兩道getActionName解析出來的, FilterDispatcher把請求的處理交給ActionProxy,下面是ServletDispatcher的 TODO:   
58             request.setAttribute(ServletActionContext.WEBWORK_VALUESTACK_KEY, proxy.getInvocation().getStack());   
59             proxy.execute();   
60          //經過代理模式執行ActionProxy  
61             if (stack != null)...{   
62                 request.setAttribute(ServletActionContext.WEBWORK_VALUESTACK_KEY,stack);   
63             }   
64         } catch (ConfigurationException e) ...{   
65             log.error("Could not find action", e);   
66             sendError(request, response, HttpServletResponse.SC_NOT_FOUND, e);   
67         } catch (Exception e) ...{   
68             log.error("Could not execute action", e);   
69             sendError(request, response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e);   
70         }   
71 } 

四、若是ActionMapper決定須要調用某個Action,FilterDispatcher把請求的處理交給ActionProxy 

    五、ActionProxy經過ConfigurationManager詢問框架的配置文件,找到須要調用的Action類 ,這裏,咱們通常是從struts.xml配置中讀取。

    六、ActionProxy建立一個ActionInvocation的實例。

    七、ActionInvocation實例使用命名模式來調用,在調用Action的過程先後,涉及到相關攔截器(Intercepter)的調用。

    下面咱們來看看ActionInvocation是如何工做的:

    ActionInvocation是Xworks 中Action 調度的核心。而對Interceptor 的調度,也正是由ActionInvocation負責。ActionInvocation 是一個接口,而DefaultActionInvocation 則是Webwork 對ActionInvocation的默認實現。

    Interceptor的調度流程大體以下:

    1.ActionInvocation初始化時,根據配置,加載Action相關的全部Interceptor。

    2. 經過ActionInvocation.invoke方法調用Action實現時,執行Interceptor。

    Interceptor將不少功能從咱們的Action中獨立出來,大量減小了咱們Action的代碼,獨立出來的行爲具備很好的重用性。XWork、WebWork的許多功能都是有Interceptor實現,能夠在配置文件中組裝Action用到的Interceptor,它會按照你指定的順序,在Action執行先後運行。

    這裏,咱們簡單的介紹一下Interceptor

    在struts2中自帶了不少攔截器,在struts2-core-2.1.6.jar這個包下的struts-default.xml中咱們能夠發現:

 1 <interceptors>  
 2            <interceptor name="alias"class="com.opensymphony.xwork2.interceptor.AliasInterceptor"/>  
 3            <interceptor name="autowiring"class="com.opensymphony.xwork2.spring.interceptor.ActionAutowiringInterceptor"/>  
 4            <interceptor name="chain"class="com.opensymphony.xwork2.interceptor.ChainingInterceptor"/>  
 5            <interceptor name="conversionError"class="org.apache.struts2.interceptor.StrutsConversionErrorInterceptor"/>  
 6            <interceptor name="clearSession"class="org.apache.struts2.interceptor.ClearSessionInterceptor"/>  
 7            <interceptor name="createSession"class="org.apache.struts2.interceptor.CreateSessionInterceptor"/>  
 8            <interceptor name="debugging"class="org.apache.struts2.interceptor.debugging.DebuggingInterceptor"/>  
 9            <interceptor name="externalRef"class="com.opensymphony.xwork2.interceptor.ExternalReferencesInterceptor"/>  
10            <interceptor name="execAndWait"class="org.apache.struts2.interceptor.ExecuteAndWaitInterceptor"/>  
11            <interceptor name="exception"class="com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor"/>  
12            <interceptor name="fileUpload"class="org.apache.struts2.interceptor.FileUploadInterceptor"/>  
13            <interceptor name="i18n"class="com.opensymphony.xwork2.interceptor.I18nInterceptor"/>  
14            <interceptor name="logger"class="com.opensymphony.xwork2.interceptor.LoggingInterceptor"/>  
15            <interceptor name="modelDriven"class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>  
16            <interceptor name="scopedModelDriven"class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"/>  
17            <interceptor name="params"class="com.opensymphony.xwork2.interceptor.ParametersInterceptor"/>  
18            <interceptor name="actionMappingParams"class="org.apache.struts2.interceptor.ActionMappingParametersInteceptor"/>  
19            <interceptor name="prepare"class="com.opensymphony.xwork2.interceptor.PrepareInterceptor"/>  
20            <interceptor name="staticParams"class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>  
21            <interceptor name="scope"class="org.apache.struts2.interceptor.ScopeInterceptor"/>  
22            <interceptor name="servletConfig"class="org.apache.struts2.interceptor.ServletConfigInterceptor"/>  
23            <interceptor name="sessionAutowiring"class="org.apache.struts2.spring.interceptor.SessionContextAutowiringInterceptor"/>  
24            <interceptor name="timer"class="com.opensymphony.xwork2.interceptor.TimerInterceptor"/>  
25            <interceptor name="token"class="org.apache.struts2.interceptor.TokenInterceptor"/>  
26            <interceptor name="tokenSession"class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/>  
27            <interceptor name="validation"class="org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor"/>  
28            <interceptor name="workflow"class="com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor"/>  
29            <interceptor name="store"class="org.apache.struts2.interceptor.MessageStoreInterceptor"/>  
30            <interceptor name="checkbox"class="org.apache.struts2.interceptor.CheckboxInterceptor"/>  
31            <interceptor name="profiling"class="org.apache.struts2.interceptor.ProfilingActivationInterceptor"/>  
32            <interceptor name="roles"class="org.apache.struts2.interceptor.RolesInterceptor"/>  
33            <interceptor name="jsonValidation"class="org.apache.struts2.interceptor.validation.JSONValidationInterceptor"/>  
34            <interceptornameinterceptorname="annotationWorkflow"class="com.opensymphony.xwork2.interceptor.annotations.AnnotationWorkflowInterceptor"/>  

對於sturts2自帶的攔截器,使用起來就相對比較方便了,咱們只須要在struts.xml的action標籤中加入<interceptor-ref name=" logger " />而且struts.xml擴展struts-default,就可使用,

   若是是要自定義攔截器,首先須要寫一個攔截器的類:

 1 package ceshi;  
 2 import com.opensymphony.xwork2.ActionInvocation;  
 3 import com.opensymphony.xwork2.interceptor.AbstractInterceptor;  
 4    
 5 publicclassAuthorizationInterceptor extends AbstractInterceptor {  
 6    
 7     @Override  
 8     public Stringintercept(ActionInvocation ai)throws Exception {  
 9          
10            System.out.println("abc");  
11             return ai.invoke();  
12              
13     }  
14    
15 }  

而且在struts.xml中進行配置

 1 <!DOCTYPEstruts PUBLIC  
 2 "-//Apache SoftwareFoundation//DTD Struts Configuration 2.0//EN"  
 3 "http://struts.apache.org/dtds/struts-2.0.dtd">  
 4    
 5    
 6 <struts>  
 7     <package name="test"extends="struts-default">  
 8      <interceptors>  
 9       <interceptor name="abc"class ="ceshi.AuthorizationInterceptor"/>  
10     </interceptors>  
11         <action name="TestLogger"class="vaannila.TestLoggerAction">  
12            <interceptor-refnameinterceptor-refname="abc"/>  
13            <result name="success">/success.jsp</result>  
14            </action>  
15     </package>  
16 </struts> 

八、一旦Action執行完畢,ActionInvocation負責根據struts.xml中的配置找到對應的返回結果。返回結果一般是(但不老是,也多是另外的一個Action鏈)一個須要被表示的JSP或者FreeMarker的模版。在表示的過程當中可使用Struts2 框架中繼承的標籤。在這個過程當中須要涉及到ActionMapper

 

在上述過程當中全部的對象(Action,Results,Interceptors,等)都是經過ObjectFactory來建立的。

 

Struts2和struts1的比較

    struts2相對於struts1來講簡單了不少,而且功能強大了不少,咱們能夠從幾個方面來看:

    從體系結構來看:struts2大量使用攔截器來出來請求,從而容許與業務邏輯控制器 與 servlet-api分離,避免了侵入性;而struts1.x在action中明顯的侵入了servlet-api.

    從線程安全分析:struts2.x是線程安全的,每個對象產生一個實例,避免了線程安全問題;而struts1.x在action中屬於單線程。

    性能方面:struts2.x測試能夠脫離web容器,而struts1.x依賴servlet-api,測試須要依賴web容器。

    請求參數封裝對比:struts2.x使用ModelDriven模式,這樣咱們 直接 封裝model對象,無須要繼承任何struts2的基類,避免了侵入性。

    標籤的優點:標籤庫幾乎能夠徹底替代JSTL的標籤庫,而且 struts2.x支持強大的ognl表達式。

    固然,struts2和struts1相比,在 文件上傳,數據校驗 等方面也 方便了好多。在這就不詳談了。

    

    一個比較優秀的框架能夠幫着咱們更高效,穩定的開發合格的產品,不過咱們也不要依賴框架,咱們只要理解了思想,設計模式,咱們能夠本身擴展功能,否則 就要 永遠讓別人牽着走了!

2、Struts2簡單入門實例和登陸實例

 

Java Struts2簡單入門實例和登陸實例

  1 jsp出發action
  2 struts2攔截請求,調用後臺action
  3 action返回結果,由不一樣的jsp展示數據

項目結構

src
      struts.xml
      
   com
       hellostruts2
           action
                  HelloStrutsAction.java
                  LoginAction.java
                  
           model
                   HelloMessage.java
                   
WebContent
       HelloStruts.jsp
       index.jsp
       
    login
           error.jsp
           login.jsp
           success.jsp
           
    WEB-INF
           web.xml
           
        classes
               logging.properties
               mess.properties
               mess_zh_CN.properties
               
        lib
                commons-fileupload-1.3.1.jar
                commons-io-2.2.jar
                commons-lang-2.4.jar
                commons-lang3-3.2.jar
                commons-logging-1.1.3.jar
                freemarker-2.3.22.jar
                javassist-3.11.0.GA.jar
                ognl-3.0.14.jar
                struts2-core-2.3.28.1.jar
                xwork-core-2.3.28.1.jar

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" 
   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">
   
   <display-name>Struts 2</display-name>
   <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
   </welcome-file-list>
   <filter>
      <filter-name>struts2CleanupFilter</filter-name>
      <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
   </filter>
   <filter>
      <filter-name>struts2Filter</filter-name>
      <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
   </filter>

    <filter-mapping>
      <filter-name>struts2CleanupFilter</filter-name>
      <url-pattern>/*</url-pattern>
      <dispatcher>REQUEST</dispatcher>
      <dispatcher>FORWARD</dispatcher>
   </filter-mapping>
   <filter-mapping>
      <filter-name>struts2Filter</filter-name>
      <url-pattern>/*</url-pattern>
   </filter-mapping>
</web-app>

Struts.xml

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <!DOCTYPE struts PUBLIC
 3    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
 4    "http://struts.apache.org/dtds/struts-2.0.dtd">
 5 <struts>
 6     <constant name="struts.devMode" value="true" />
 7     
 8     <constant name="struts.custom.i18n.resources" value="mess"/>
 9     <constant name="struts.i18n.encoding" value="utf-8"/>
10     
11     
12     <package name="hellostruts" extends="struts-default">
13         <action name="index">
14             <result >/index.jsp</result>
15         </action>
16         <action name="hello" class="com.hellostruts2.action.HelloStrutsAction" method="execute">
17             <result name="success">/HelloStruts.jsp</result>
18         </action>
19     </package>
20     <package name="loginstruts" extends="struts-default">
21         <action name="login" class="com.hellostruts2.action.LoginAction" method="execute">
22             <result name="input">/login/login.jsp</result>
23             <result name="success">/login/success.jsp</result>
24             <result name="error">/login/error.jsp</result>
25         </action>
26     </package>
27     
28 </struts>
29 <!-- 
30 <struts>
31     <include file="my-struts1.xml"/>
32     <include file="my-struts2.xml"/>
33 </struts>
34 -->

logging.properties

org.apache.catalina.core.ContainerBase.[Catalina].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].handlers = \java.util.logging.ConsoleHandler

mess.properties

loginPage=loginPage
errorPage=errorPage
successPage=succPage
errorTip=sorry\uFF0C login failed
successTip=welcome{0},login success
user=username
pass=password
login=login

mess_zh_CN.properties

loginPage=登錄界面
errorPage=失敗界面
successPage=成功界面
errorTip=對不起,您不能登陸!
successTip=歡迎,{0},您已經登陸!
user=用戶名
pass=密 碼
login=登錄

入門實例:

HelloMessage.java

 1 package com.hellostruts2.model;
 2 
 3 public class HelloMessage {
 4     private String message;
 5     public HelloMessage(){
 6         setMessage("Hello struts2 model.");
 7     }
 8     public String getMessage() {
 9         return message;
10     }
11 
12     public void setMessage(String message) {
13         this.message = message;
14     }
15 }

HelloStrutsAction.java

 1 package com.hellostruts2.action;
 2 
 3 import com.hellostruts2.model.HelloMessage;
 4 
 5 public class HelloStrutsAction {
 6 
 7     private String name;
 8     private HelloMessage helloMessage;
 9     public String execute() throws Exception{
10         helloMessage=new HelloMessage();
11         helloMessage.setMessage("Hello struts model.");
12         return "success";
13     }
14     public String getName(){
15         return name;
16     }
17     public void setName(String name){
18         this.name=name;
19     }
20     
21     public HelloMessage getMessage(){
22         return helloMessage;
23     }
24     public void setMessage(HelloMessage helloMessage){
25         this.helloMessage=helloMessage;
26     }
27 }

index.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Hello Struts2 Form</title>
</head>
<body>
    <h1>Hello Struts2 Form</h1>
    <form action="hello">
        <label for="name">Please enter your name</label><br/>
        <input type="text" name="name"/>
        <input type="submit" value="Say Hello"/>
        <p><a href="<s:url action='hello'/>">Hello Struts Model</a></p>
    </form>
</body>
</html>

HelloStruts.jsp

 1 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
 2     pageEncoding="ISO-8859-1"%>
 3 <%@ taglib prefix="s" uri="/struts-tags" %>
 4 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 5 <html>
 6 <head>
 7 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 8 <title>Hello Struts2</title>
 9 </head>
10 <body>
11 <s:debug></s:debug>
12     Hello Struts2, <s:property value="name"/>
13     <br/>
14     Hello Model, <s:property value="message.message"></s:property>
15     ${message.message}
16 </body>
17 </html>

登陸實例:

當login.jsp觸發action時,就會向後擡發送login.action的請求,這個請求被後臺攔截,交給struts.xml中配置的action處理。

LoginAction.java

 1 package com.hellostruts2.action;
 2 
 3 import com.opensymphony.xwork2.ActionContext;
 4 import com.opensymphony.xwork2.ActionSupport;
 5 
 6 public class LoginAction extends ActionSupport {
 7     private static final long serialVersionUID = 1L;
 8     private String username;
 9     private String password;
10     public String getUsername() {
11         return username;
12     }
13     public void setUsername(String username) {
14         this.username = username;
15     }
16     public String getPassword() {
17         return password;
18     }
19     public void setPassword(String password) {
20         this.password = password;
21     }
22     public String execute() throws Exception{
23         if(getUsername().equals("test") && getPassword().equals("test")){
24             ActionContext.getContext().getSession().put("user", getUsername());
25             return SUCCESS;
26         }else{
27             return ERROR;
28         }
29     }
30     public void validate(){
31         if(username ==null || username.trim().equals("")){
32             addFieldError("username", "user name is required");
33         }
34         if(password.length()<3){
35             addFieldError("password", "password must be more than 3");
36         }
37     }
38 }

login.jsp

 1 <%@ page language="java" contentType="text/html; charset=UTF-8"
 2     pageEncoding="UTF-8"%>
 3 <%@taglib prefix="s" uri="/struts-tags" %>
 4 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 5 <html>
 6 <head>
 7 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 8 <title><s:text name="loginPage"/></title>
 9 </head>
10 <body>
11 <s:form action="login">
12     <s:textfield name="username" key="user"></s:textfield>
13     <s:textfield name="password" key="pass"></s:textfield>
14     <s:submit key="login"></s:submit>
15 </s:form>
16 </body>
17 </html>

success.jsp

 1 <%@ page language="java" contentType="text/html; charset=utf-8"
 2     pageEncoding="utf-8"%>
 3 <%@taglib prefix="s" uri="/struts-tags" %>
 4 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 5 <html>
 6 <head>
 7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 8 <title><s:text name="successPage"></s:text></title>
 9 </head>
10 <body>
11     <s:text name="successTip">
12         <s:param>${sessionScope.user}</s:param>
13     </s:text>
14 </body>
15 </html>

error.jsp

 1 <%@ page language="java" contentType="text/html; charset=utf-8"
 2     pageEncoding="utf-8"%>
 3 <%@taglib prefix="s" uri="/struts-tags" %>
 4 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 5 <html>
 6 <head>
 7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 8 <title><s:text name="errorPage"></s:text></title>
 9 </head>
10 <body>
11     <s:text name="errorTip"></s:text>
12 </body>
13 </html>

library下載:http://struts.apache.org/download.cgi

相關文章
相關標籤/搜索