步步為營

          UrlRewrite2.5.x 手冊注解

          1、run元素對應的class的方法必須為public

          <run> element
          Allows you to run a method on an object when a rule and it's conditions are matched.

          Attribute Explanation 
          class (default) The class you want to run a method on. Must be a fully qualified name. 
          method (optional, default run) The method you want to run, the method must have the parameters (HttpServletRequest, HttpServletResponse) e.g. run(HttpServletRequest request, HttpServletResponse response) 
          Note, if init(ServletConfig) or destroy() is found they will be run at when creating or destroying an instance.  
          neweachtime (optional, default false) If you want new instance of the class to be created before running each time set to true. 

          When the rule in the following example is matched, WorldServlet.goGet(HttpServletRequest, HttpServletResponse) will be invoked, the request will then be forwarded to /world-presentation.jsp.

              
          <rule>
              
          <from>^/world/[a-z]+/[a-z]+$</from>
              
          <run class="com.blah.web.WorldServlet" method="doGet" />
              
          <to>/world-presentation.jsp</to>
              
          </rule>
          Note, you can specify init-param's the same way you would for a servlet.

              
          <run class="com.blah.web.MyServlet" method="doGet">
              
          <init-param>
              
          <param-name>someParamName</param-name>
              
          <param-value>10</param-value>
              
          </init-param>
              
          </run>

          posted on 2005-10-14 20:10 java門客 閱讀(270) 評論(0)  編輯  收藏


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


          網站導航:
           
          <2005年10月>
          2526272829301
          2345678
          9101112131415
          16171819202122
          23242526272829
          303112345

          導航

          統計

          常用鏈接

          留言簿(1)

          隨筆檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 仁布县| 凉城县| 商水县| 康平县| 五原县| 郓城县| 秀山| 永德县| 丹江口市| 浮山县| 遵义市| 澜沧| 怀仁县| 恩平市| 和田县| 焉耆| 晋宁县| 通化市| 南通市| 巩义市| 临海市| 胶南市| 兴安盟| 黄骅市| 大姚县| 罗甸县| 元谋县| 上蔡县| 赣州市| 青铜峡市| 汉沽区| 新田县| 乌兰浩特市| 连山| 吴旗县| 南京市| 安龙县| 汤原县| 会理县| 香港 | 海原县|