<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    木木

      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
      21 隨筆 :: 4 文章 :: 5 評論 :: 0 Trackbacks
    1. 下載stripes.jar包,并把它放進/WEB/lib目錄下
    2. 復制StripesResources.properties到/WEB/classes目錄下
    3.  配置

        使用Stripes首先在web.xml中要做以下配置
       

     1<filter>
     2        <display-name>Stripes Filter</display-name>
     3        <filter-name>StripesFilter</filter-name>
     4        <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
     5    </filter>
     6    
     7    <filter-mapping>
     8        <filter-name>StripesFilter</filter-name>
     9        <url-pattern>*.jsp</url-pattern>
    10        <dispatcher>REQUEST</dispatcher>
    11    </filter-mapping>
    12    
    13    <filter-mapping>
    14        <filter-name>StripesFilter</filter-name>
    15        <servlet-name>StripesDispatcher</servlet-name>
    16        <dispatcher>REQUEST</dispatcher>
    17    </filter-mapping>
    18    
    19    <servlet>
    20        <servlet-name>StripesDispatcher</servlet-name>
    21        <servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class>
    22        <load-on-startup>1</load-on-startup>
    23    </servlet>
    24    
    25    <servlet-mapping>
    26        <servlet-name>StripesDispatcher</servlet-name>
    27        <url-pattern>*.action</url-pattern>
    28    </servlet-mapping>
    29


       4、寫前臺jsp頁面

    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld"%>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
      
    <head><title>My First Stripe</title></head>
      
    <body>   

        
    <stripes:form action="/test.action" focus="">
            
    <table>
                
    <tr>
                    
    <td>名字:</td>
                    
    <td><stripes:text name="name"/></td>
                
    </tr>
                
    <tr>
                    
    <td>密碼:</td>
                    
    <td><stripes:text name="password"/></td>
                
    </tr>
                
    <tr>
                    
    <td colspan="2">
                        
    <stripes:submit name="execute" value="提交"/>                    
                    
    </td>
                
    </tr>
                
    <tr>
                    
    <td>結果:</td>
                    
    <td>${actionBean.result}</td>
                
    </tr>
            
    </table>
        
    </stripes:form>
      
    </body>
    </html>


      5、后臺

     1package com.test.action;
     2
     3import net.sourceforge.stripes.action.ActionBean;
     4import net.sourceforge.stripes.action.ActionBeanContext;
     5import net.sourceforge.stripes.action.DefaultHandler;
     6import net.sourceforge.stripes.action.ForwardResolution;
     7import net.sourceforge.stripes.action.Resolution;
     8
     9public class Test implements ActionBean {
    10  private String name;
    11  private String password;
    12  private String result;
    13  @DefaultHandler
    14  public Resolution execute() {
    15     result="用戶名為:"+name+"  密碼為:"+password; 
    16     return new ForwardResolution("/test1.jsp");
    17  }

    18  public String getResult() {
    19    return result;
    20}

    21  private ActionBeanContext context;
    22  
    23  public void setPassword(String password) {
    24    this.password = password;
    25}

    26  public void setName(String name) {
    27    this.name = name;
    28}

    29  
    30    public ActionBeanContext getContext() {
    31        
    32        return context;
    33    }

    34
    35    public void setContext(ActionBeanContext context) {
    36        this.context=context;
    37
    38    }

    39
    40}

    41


     6、 在Tomcat中訪問http://localhost:8080/Test.action即可

    posted on 2008-03-10 13:38 KTOO 閱讀(777) 評論(0)  編輯  收藏 所屬分類: stripes

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 亚洲欧美第一成人网站7777| 亚洲黄色三级网站| 免费大片黄在线观看| 免费视频中文字幕| 亚洲s码欧洲m码吹潮| 国产大片线上免费看| 午夜免费国产体验区免费的 | 亚洲国产成人精品激情| 四虎1515hh永久久免费| 亚洲免费电影网站| 午夜毛片不卡免费观看视频| 亚洲欧美成人一区二区三区| 国产免费人人看大香伊| 高清免费久久午夜精品 | 久久受www免费人成_看片中文| 亚洲视频在线观看2018| 免费理论片51人人看电影| 五月天国产成人AV免费观看| 国产亚洲精品资源在线26u| 亚洲国产成人a精品不卡在线| 免费高清A级毛片在线播放| 亚洲精品成人片在线播放| 美女内射无套日韩免费播放| 麻豆狠色伊人亚洲综合网站| 国产三级电影免费观看| 好男人资源在线WWW免费| 亚洲狠狠久久综合一区77777| 免费无码成人AV在线播放不卡| 亚洲伦理一二三四| 少妇亚洲免费精品| 99re热精品视频国产免费| 亚洲中文无码永久免费| 亚洲中久无码不卡永久在线观看| 久久国产精品萌白酱免费| 亚洲熟女www一区二区三区| 亚洲国产精品综合久久网络| 性xxxxx大片免费视频| 亚洲av永久无码| 亚洲成AV人片在| 国产一精品一aⅴ一免费| 国产啪精品视频网站免费尤物|