大家看下我这代码对吗??我想实现的是在浏览器的地址栏上看到的是html的地址 <outbound-rule>
        <from>^/xinxis.shtml\?method=welcome&amp;shortId=([0-9]+)&amp;key=</from>
        <to>%{context-path}/xinxins/welcome/$1.html</to>
    </outbound-rule>

解决方案 »

  1.   

    下面是我的伪静态规则
    <rule>
     <from>^/xinxi/getXinxiById/([0-9]+).html$</from>
    <to>/xinxi.shtml?method=getXinxiById&amp;id=$1&amp;key=</to>
    </rule><outbound-rule>
    <from>xinxi\.shtml\?method=getXinxiById&amp;id=([0-9]+)&amp;key=$</from> 
    <to>/xinxi/getXinxiById/$1.html</to>
    </outbound-rule>
    超链处是用的response.encodeURL(
    <%=request.getContextPath() %>+"/xinxis.shtml?method=welcome&shortId="+<%=fenlei.getId()%>+"&key="${key})
    可为什么没有点超链后显示的还是原来的地址,没有自动转成html页面呢????
      

  2.   

    jsp里面就要写成/xinxi/getXinxiById/([0-9]+).html这个样子的,而不是动态的链接但是本质url会转成/xinxi.shtml?method=getXinxiById&amp;id=$1&amp;key=的链接。