2012-03-02 38 views
0

应该是什么下列URL路径的服务器URL模式:发现的servlet url-pattern的


INFO: Pre-instantiating singletons in org.s[email protected]7bbf68a9: defining beans [restfulController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.web.servlet.view.BeanNameViewResolver#0,policyView,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy 
Mar 5, 2012 11:51:05 AM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler 
INFO: Mapped URL path [/restservice/number] onto handler 'restfulController' 
Mar 5, 2012 11:51:05 AM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler 
INFO: Mapped URL path [/restservice/number.*] onto handler 'restfulController' 
Mar 5, 2012 11:51:05 AM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler 
INFO: Mapped URL path [/restservice/number/] onto handler 'restfulController' 
Mar 5, 2012 11:51:05 AM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler 
INFO: Mapped URL path [/restservice/policyA] onto handler 'restfulController' 
Mar 5, 2012 11:51:05 AM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler 
INFO: Mapped URL path [/restservice/policyA.*] onto handler 'restfulController' 
Mar 5, 2012 11:51:05 AM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler 
INFO: Mapped URL path [/restservice/policyA/] onto handler 'restfulController' 
Mar 5, 2012 11:51:05 AM org.springframework.web.servlet.FrameworkServlet initServletBean 

我已经试过/ restservice *,/ restservice/*但只/ *正在工作。

+0

这应该工作 - 你可以应该你的Servlet映射? – home 2012-03-02 15:51:15

+0

@home nope!/service/*不起作用。我是否缺少web.xml中的其他servlet元素? – 2012-03-02 15:56:10

+0

你可以显示映射吗? – home 2012-03-02 16:02:51

回答

0

我能够通过从我的Spring控制器中删除/ restservice /来解决它。

1

您应该使用/ *。如果你使用“/ restservice/*”,你必须调用<>/restservice/restservice/... 你可以尝试使用一个子字符而不是前缀..例如* .do或其他。

+0

使用“/ restservice/*”,并调用<>/restservice/restservice/...也不起作用。 – 2012-03-05 17:56:09