web.xml and 使用RESTfull url

问题描述:

在java6上使用带有jax-rs(球衣)的tomcat 6时,我希望我的客户端能够使用http GET/order但不能GET/order/42web.xml <url-pattern> and <security-constraint>使用RESTfull url

如果我把类似/顺序/ *它也匹配/订单

即:

<web-resource-collection> 
    <web-resource-name>show a specific order</web-resource-name> 
    <url-pattern>/order/*</url-pattern> 
    <http-method>GET</http-method> 
    </web-resource-collection> 

如果我http://localhost/order - > 401 相同的故事http://localhost/order/42

我相信这是不是web.xml中实现的,但为了以防万一......

作为一种变通方法,

您可以在/order/*配置过滤器并检查URL。如果其/order/something将其重定向到安全的URL