天天看點

Webwork2 學習

1 . webwork的基本運作配置 

 主要為web.xml和xwork.xml的配置:

Webwork2 學習

<? xml version="1.0" encoding="UTF-8"  ?>

Webwork2 學習

< web-app  version ="2.4"  xmlns ="http://java.sun.com/xml/ns/j2ee"  xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation ="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >

Webwork2 學習

     < display-name > ww </ display-name >

Webwork2 學習

     < filter >

Webwork2 學習

         < filter-name > webwork </ filter-name >

Webwork2 學習

         < filter-class > com.opensymphony.webwork.dispatcher.FilterDispatcher </ filter-class >

Webwork2 學習

     </ filter >

Webwork2 學習

     < filter-mapping >

Webwork2 學習

         < filter-name > webwork </ filter-name >

Webwork2 學習

         < url-pattern > /* </ url-pattern >

Webwork2 學習

     </ filter-mapping >

Webwork2 學習

     < jsp-config >

Webwork2 學習

         < taglib >

Webwork2 學習

             < taglib-uri > webwork </ taglib-uri >

Webwork2 學習

             < taglib-location > /WEB-INF/lib/webwork-2.2.5.jar </ taglib-location >

Webwork2 學習

         </ taglib >

Webwork2 學習

     </ jsp-config >

Webwork2 學習

     < welcome-file-list >

Webwork2 學習

         < welcome-file > index.html </ welcome-file >

Webwork2 學習

         < welcome-file > index.htm </ welcome-file >

Webwork2 學習

         < welcome-file > index.jsp </ welcome-file >

Webwork2 學習

     </ welcome-file-list >

Webwork2 學習

</ web-app >

Webwork2 學習

xwork.xml配置如下:

Webwork2 學習

<? xml version="1.0" encoding="UTF-8" ?>

Webwork2 學習

<! DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN" 

Webwork2 學習

"http://www.opensymphony.com/xwork/xwork-1.0.dtd" >

Webwork2 學習
Webwork2 學習

< xwork >

Webwork2 學習

     <!--  Include webwork defaults (from WebWork JAR).  -->

Webwork2 學習

     < include  file ="webwork-default.xml"   />

Webwork2 學習
Webwork2 學習

     <!--  Configuration for the default package.  -->

Webwork2 學習

     < package  name ="default"  extends ="webwork-default" >

Webwork2 學習

         < action  name ="要映射的Action的名稱"  class ="你的java類的路徑" >

Webwork2 學習

             < result  name ="success"  type ="dispatcher" > 要傳回的路徑 </ result >

Webwork2 學習

         </ action >

Webwork2 學習

     </ package >

Webwork2 學習

</ xwork >

Webwork2 學習

繼續閱讀