zoukankan      html  css  js  c++  java
  • 解决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>
  • 相关阅读:
    .net core webapi +ddd(领域驱动)+nlog配置+swagger配置 学习笔记(2)
    .net core webapi +ddd(领域驱动)+nlog配置+swagger配置 学习笔记(1)
    css规范
    eclipse for python
    CentOs时间不同步问题
    SecureCRT怎么将本级文件上传到CentOS
    tcp客户端程序开发
    C++STL小结
    食用指北
    Hello, world!
  • 原文地址:https://www.cnblogs.com/qrlozte/p/3499792.html
Copyright © 2011-2022 走看看