以下URL路径的servlet url-pattern应该是什么:
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@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 :(得分:1)
你应该使用/*.
如果您使用“/ restservice / *”,则必须调用<> / restservice / restservice / ... 您可以尝试使用subfix而不是前缀..例如* .do或其他。
答案 1 :(得分:0)
我可以通过从Spring Controller中删除/ restservice /来解决它。