How to display error message in my JSP page using spring security 2.0

前端 未结 6 877
忘了有多久
忘了有多久 2021-01-05 11:52

Hi I am now using spring security. It works fine. But if login failed, no error message display. I am wondering how can I display error message?

I have configured th

6条回答
  •  不思量自难忘°
    2021-01-05 12:24

    Maybe you can try this...put

    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    

    for c tag on jsp page, and then put something like below for error msg display

    
    

    Wrong id or password!

    "param.error == 1" can get return value from Spring Security(security-config.xml) like

    
        
                
            /login.action?error=1
              
        
    
    

提交回复
热议问题