在名称为'dispatcher'的DispatcherServlet中找不到带有URI [/app/j_spring_security_login]的HTTP请求的映射 [英] No mapping found for HTTP request with URI [/app/j_spring_security_login] in DispatcherServlet with name 'dispatcher'
问题描述
我将此登录链接添加到了我的Spring应用程序:
I added this login link to my Spring app:
<a href="<spring:url value="/j_spring_security_login" htmlEscape="true" />">
Sign In
</a>
我的假设是,因为这是用于访问登录页面的内置标签,所以Spring会知道如何将其与适当的处理程序相关联,而无需我明确地指定它.
My assumption was that because this is a built-in tag for accessing the login page, Spring would know how to associate this with an appropriate handler without me having to specify it explicitly.
但是,它会产生以下错误:
However, it generates the following error:
org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI
[/app/j_spring_security_login] in DispatcherServlet with name 'dispatcher'
为此URL定义处理程序的合适方法是什么?
What's the appropriate way to define the handler for this URL?
推荐答案
/j_spring_security_login
是Spring Security的特殊URL,因此它由Spring Security过滤器处理,您无需为其定义任何其他处理程序.只需检查您是否具有正确配置和映射的Spring Security过滤器,如
/j_spring_security_login
is a special Spring Security's url, so it's handled by the Spring Security filter and you don't need to define any other handler for it. Just check that you have a properly configured and mapped Spring Security filter, as described here.
这篇关于在名称为'dispatcher'的DispatcherServlet中找不到带有URI [/app/j_spring_security_login]的HTTP请求的映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!