2013-02-04 38 views
2

tuckey.web.filters.urlrewrite.UrlRewriteFilter`改写,但春天urlrewrite

<urlrewrite> 
    <rule> 
     <from>^/ms-office$</from> 
     <to>/office</to> 
    </rule> 
    <rule> 
     <from>/ms-office/(^[0-9]+$)</from> 
     <to>/office/eidt?id=$1</to> 
    </rule> 
</urlrewrite> 

,当我进入ms-office/10一个获得WARNING: No mapping found for HTTP request with URI [/s-mvc/ms-office/10] in DispatcherServlet with name 'config'

+0

我没有看到这与Spring有什么关系,但它看起来像在你的元素中有一个错字。我想这应该是:/ office/edit/id = $ 1 – CodeChimp

+1

第二个'from'应该匹配'/ ms-office/10'还是'/ whatever/ms-office/10'?如果第一个,那么你错过了第一个规则中的^^anchor。 – Tom

+0

@Tom发表评论,以便我接受 –

回答

0

如果第二from应该匹配/ms-office/10那么你错过了^锚如第一条规则。