步步為營

          UrlRewrite2.5.x 手冊注解

          1、run元素對應(yīng)的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)  編輯  收藏


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


          網(wǎng)站導(dǎo)航:
           
          <2005年10月>
          2526272829301
          2345678
          9101112131415
          16171819202122
          23242526272829
          303112345

          導(dǎo)航

          統(tǒng)計(jì)

          常用鏈接

          留言簿(1)

          隨筆檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 龙南县| 长垣县| 元谋县| 垣曲县| 洪雅县| 阿拉善右旗| 新沂市| 宜城市| 内江市| 正镶白旗| 明溪县| 合水县| 阿瓦提县| 保德县| 宿松县| 远安县| 丹巴县| 渑池县| 罗平县| 革吉县| 苍山县| 黄浦区| 巴彦县| 沛县| 罗平县| 公安县| 星座| 高州市| 内丘县| 工布江达县| 仙游县| 竹北市| 利辛县| 当雄县| 南陵县| 定陶县| 上犹县| 莱州市| 宁都县| 武平县| 宣恩县|