jsp伪静态

1   在web.xml配置文件中

 

    <filter>
  <filter-name>UrlRewriteFilter</filter-name>
  <filter-class>
   org.tuckey.web.filters.urlrewrite.UrlRewriteFilter
  </filter-class>
 </filter>
 <filter-mapping>
  <filter-name>UrlRewriteFilter</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>
 

 

2  引入jar包  urlrewrite-2.6.0.jar

 

 

3  在web—INF 中加入文件urlrewrite.xml

     <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 2.6//EN"
        "http://tuckey.org/res/dtds/urlrewrite2.6.dtd">
<urlrewrite>
    <rule>
        <from>^/index.html$</from>
        <to>/index.jsp</to>
    </rule>
    <rule> 
        <from>^/222View_([0-9]+).html$</from> 
        <to>/base/222Action.do?method=load222&amp;222VO.222Id=$1</to> 
    </rule> 
       <rule> 
        <from>^/query222.html$</from> 
        <to>/222Action.do?method=query2222</to> 
    </rule>
   <outbound-rule>
        <from>/index.jsp</from>
        <to>/index.html</to>
    </outbound-rule>

</urlrewrite>

你可能感兴趣的:(html,Web,xml,jsp)