• 解决The markup in the document following the root element must be well-formed.


    出现问题的代码:

      

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>RegisteredUsers</web-resource-name>
            <url-pattern>/ch06/6.3/6.3.4/security.jsp</url-pattern>
        </web-resource-collection>
        <auth-constraint> <!-- 可以访问的角色 -->
            <role-name>registered_user</role-name>
            <role-name>admin</role-name>
        </auth-constraint>
    </security-constraint>
    
    <login-config>
        <auth-method>BASIC</auth-method>
        <realm-name>Registered Users</realm-name>
    </login-config>
    
    <security-role>
        <role-name>admin</role-name>
    </security-role>
    
    <security-role>
        <role-name>registered_user</role-name>
    </security-role>

    解决方法:

    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
        http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
        <security-constraint>
            <web-resource-collection>
                <web-resource-name>RegisteredUsers</web-resource-name>
                <url-pattern>/ch06/6.3/6.3.4/security.jsp</url-pattern>
            </web-resource-collection>
            <auth-constraint> <!-- 可以访问的角色 -->
                <role-name>registered_user</role-name>
                <role-name>admin</role-name>
            </auth-constraint>
        </security-constraint>
    
        <login-config>
            <auth-method>BASIC</auth-method>
            <realm-name>Registered Users</realm-name>
        </login-config>
    
        <security-role>
            <role-name>admin</role-name>
        </security-role>
    
        <security-role>
            <role-name>registered_user</role-name>
        </security-role>
    </web-app>
  • 相关阅读:
    【洛谷P3469】[POI2008]BLO-Blockade
    【洛谷P3225】[HNOI2012]矿场搭建
    【洛谷P4568】[JLOI2011]飞行路线
    读入优化与输出优化模板
    7.29NOIP模拟赛
    【洛谷P3627】[APIO2009]抢掠计划
    【洛谷P1582】倒水
    运lucky
    【数据结构】浅谈倍增求LCA
    【题解】洛谷P4180 [BJWC2010] 严格次小生成树(最小生成树+倍增求LCA)
  • 原文地址:https://www.cnblogs.com/qrlozte/p/3499792.html
Copyright © 2020-2023  润新知