0
我得到这样的:异常时要尽量达到我webfunction我春天:PageNotFound noHandlerFound警告:没有映射的DispatcherServlet发现HTTP请求与URI名称为
PageNotFound noHandlerFound WARNING: No mapping found for HTTP request with URI in DispatcherServlet with name
在cotroller我:
@Controller
@RequestMapping("/user/**")
@Scope("request")
和在网络功能:
@RequestMapping(value = "test", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE)
在web.xml我添加:
<servlet-mapping>
<servlet-name>webApplication</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
,并试图达到ADRESS后:
http://localhost:8087/webApp-project/rest/user/test
我得到异常:
cze 21, 2016 10:12:00 AM org.springframework.web.servlet.PageNotFound noHandlerFound
WARNING: No mapping found for HTTP request with URI [/webApp-project/rest/user/test] in DispatcherServlet with name 'webApp'
问题解决了通过添加:
<beans:bean class="com.capgemini.webApp.project.process.engine.authentication.UserRest" name="/rest/*"></beans:bean>
要配置文件。请有人能告诉我为什么它解决了这个问题吗?我有注解驱动的配置。
现在我想用Spring Security来保护页面,并且遇到了问题,也许是因为这个bean定义导致的?