]]>UrlRewrite2.5.x 鎵嬪唽娉ㄨВhttp://www.tkk7.com/w197618/archive/2005/10/14/15544.htmljava闂ㄥjava闂ㄥFri, 14 Oct 2005 12:10:00 GMThttp://www.tkk7.com/w197618/archive/2005/10/14/15544.htmlhttp://www.tkk7.com/w197618/comments/15544.htmlhttp://www.tkk7.com/w197618/archive/2005/10/14/15544.html#Feedback0http://www.tkk7.com/w197618/comments/commentRss/15544.htmlhttp://www.tkk7.com/w197618/services/trackbacks/15544.html1銆乺un鍏冪礌瀵瑰簲鐨刢lass鐨勬柟娉曞繀欏諱負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>