The markup in the document following the root element must be well-formed를 해결합니다.

9087 단어 document
문제가 발생한 코드:
  
<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>

좋은 웹페이지 즐겨찾기