首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    Spring Security入门(基于SSM环境配置)

    4. 配置成功和失败的处理器 通过实现AuthenticationSuccessHandler接口和AuthenticationFailureHandler实现 public class FailureHandler implements AuthenticationFailureHandler { @Override public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) throws IOException, ServletException { response.getWriter().write(WriteStatusJson.loginStatus("status","Failure")); } } public class SuccessHandler implements AuthenticationSuccessHandler { @Override public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { response.getWriter().write(WriteStatusJson.loginStatus("status","success")); } }

    01
    领券