Buggy code:
public class PageProtectionContextListener implements ServletContextListener { public static Logger logger = LoggerFactory . getLogger ( PageProtectionContextListener . class ) ; public static RequestConstrainManager rcm ; private static final String NODE_ATTR_URL = "url" ; private static final String NODE_ATTR_ROLE = "role" ; private static final String NODE_ATTR_TO_URL = "to-url" ; private static final String LOGIN_URL = "url" ; public static final String INIT_PARM_STATIC_RESOURCE_PATH = "STATIC_RESOURCE_PATH" ; public static final String INIT_PARM_SECURITY_CONFIG_PATH = "SECURITY_CONFIG_PATH" ; public static String SECURITY_CONFIG_PATH = "//WEB-INF//security-page.xml" ; public static String STATIC_RESOURCE_PATH = "//resources" ; @ Override public void contextDestroyed ( ServletContextEvent arg0 ) { } @ Override public void contextInitialized ( ServletContextEvent event ) { } private void loadContextParameter ( ServletContext ctx ) { } private RequestConstrainManager parseConstrain ( Element root ) { RequestConstrainManager manager = new RequestConstrainManager ( ) ; if ( root . hasChildNodes ( ) ) { NodeList nodes = root . getChildNodes ( ) ; for ( int ix = 0 ; ix < ( nodes . getLength ( ) ) ; ++ ix ) { Node node = nodes . item ( ix ) ; if ( node instanceof Element ) { Element tag = ( ( Element ) ( node ) ) ; String tagName = tag . getTagName ( ) ; if ( ( false == ( "request" . equals ( tagName ) ) ) && ( false == ( "login-page" . equals ( tagName ) ) ) ) { throw new InvalidXmlFileException ( ( ( "标签<" + ( tag . getTagName ( ) ) ) + ">不存在" ) ) ; } if ( "login-page" . equals ( tagName ) ) { String url = tag . getAttribute ( PageProtectionContextListener . LOGIN_URL ) ; if ( ( null == url ) || ( url . isEmpty ( ) ) ) { throw new InvalidXmlFileException ( ( ( ( ( "标签<" + tagName ) + ">缺少'" ) + ( PageProtectionContextListener . LOGIN_URL ) ) + "'属性" ) ) ; } <START_BUG> this . rcm . setLoginUrl ( url ) ; <END_BUG> if ( PageProtectionContextListener . logger . isDebugEnabled ( ) ) { PageProtectionContextListener . logger . debug ( "登陆页面url:{}" , url ) ; } continue ; } String url = tag . getAttribute ( PageProtectionContextListener . NODE_ATTR_URL ) ; String roles = tag . getAttribute ( PageProtectionContextListener . NODE_ATTR_ROLE ) ; String toUrl = tag . getAttribute ( PageProtectionContextListener . NODE_ATTR_TO_URL ) ; if ( url . isEmpty ( ) ) { throw new InvalidXmlFileException ( ( ( ( ( "标签<" + ( tag . getTagName ( ) ) ) + ">缺少'" ) + ( PageProtectionContextListener . NODE_ATTR_URL ) ) + "'属性" ) ) ; } if ( roles . isEmpty ( ) ) { throw new InvalidXmlFileException ( ( ( ( ( "标签<" + ( tag . getTagName ( ) ) ) + ">缺少'" ) + ( PageProtectionContextListener . NODE_ATTR_ROLE ) ) + "'属性" ) ) ; } String [ ] roleArray = roles . split ( "<seq2seq4repair_space>" ) ; if ( PageProtectionContextListener . logger . isDebugEnabled ( ) ) { Arrays . stream ( roleArray ) . forEach ( ( roleName ) -> { PageProtectionContextListener . logger . debug ( ( ( ( "找到role限制:<" + url ) + "><seq2seq4repair_space>:<seq2seq4repair_space>" ) + roleName ) ) ; } ) ; } manager . put ( url , new RoleInfo ( toUrl , roleArray ) ) ; } } } return manager ; } private Document getXmlDocumentObject ( ServletContext ctx ) throws IOException , ParserConfigurationException , SAXException { } }

Fix:
manager . setLoginUrl ( url ) ;