Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsp J_安全检查会话未结束_Jsp_Security_Session_Web.xml_J Security Check - Fatal编程技术网

Jsp J_安全检查会话未结束

Jsp J_安全检查会话未结束,jsp,security,session,web.xml,j-security-check,Jsp,Security,Session,Web.xml,J Security Check,我是一个试图学习jsp的初学者,在j_security_check的帮助下创建了一个登录页面 在web.xml中的以下代码中,您可以看到受保护文件夹中的所有内容都需要您登录才能访问 <welcome-file-list> <welcome-file>protected/home.jsp</welcome-file> </welcome-file-list> <security-constraint> <displ

我是一个试图学习jsp的初学者,在j_security_check的帮助下创建了一个登录页面

web.xml
中的以下代码中,您可以看到受保护文件夹中的所有内容都需要您登录才能访问

<welcome-file-list>
    <welcome-file>protected/home.jsp</welcome-file>
</welcome-file-list>

<security-constraint>
    <display-name>Security Constraint</display-name>
    <web-resource-collection>
        <web-resource-name>Protected Area</web-resource-name>
        <url-pattern>/protected/*</url-pattern>
        <http-method>DELETE</http-method>
        <http-method>GET</http-method>
        <http-method>POST</http-method>
        <http-method>PUT</http-method>
    </web-resource-collection>
    <auth-constraint>
        <role-name> manager </role-name>
    </auth-constraint>
    <user-data-constraint>
        <transport-guarantee>NONE</transport-guarantee>
    </user-data-constraint>
</security-constraint>

<login-config>
    <auth-method>FORM</auth-method>
    <realm-name>Example Form-Based Authentication Area</realm-name>
    <form-login-config>
        <form-login-page>/protected/home.jsp</form-login-page>
        <form-error-page>/error.jsp</form-error-page>
    </form-login-config>
</login-config>
<security-role>
    <description> An administrator </description>
    <role-name> manager </role-name>
</security-role>

protected/home.jsp
安全约束
保护区
/保护/*
删除
得到
邮递
放
(除了最后一个,因为
FacesContext
出现了一些问题)


但它们似乎都不起作用。所以我的问题是如何注销?我的结构有什么问题吗?感谢所有帮助。

只需将登录页面更改为实际登录页面:


/login.jsp
/error.jsp