serverlet_serverlet生命周期_serverlet 书(8)

电脑杂谈  发布时间:2017-03-02 13:01:40  来源:网络整理

<res-ref-name>jdbc/sample_db</res-ref-name>

<res-type>javax.sql.DataSource</res-type>

<res-auth>Container</res-auth>

</resource-ref>

15、安全限制配置

<security-constraint>

<display-name>Example Security Constraint</display-name>

<web-resource-collection>

<web-resource-name>Protected Area</web-resource-name>

<url-pattern>/jsp/security/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>tomcat</role-name>

<role-name>role1</role-name>

</auth-constraint>

</security-constraint>

16、登陆验证配置

<login-config>

<auth-method>FORM</auth-method>

<realm-name>Example-Based Authentiation Area</realm-name>

<form-login-config>

<form-login-page>/jsp/security/protected/login.jsp</form-login-page>

<form-error-page>/jsp/security/protected/error.jsp</form-error-page>

</form-login-config>

</login-config>

17、安全角色:security-role元素给出安全角色的一个列表,这些角色将出现在servlet元素内的security-role-ref元素的role-name子元素中。

分别地声明角色可使高级IDE处理安全信息更为容易。

<security-role>

<role-name>tomcat</role-name>

</security-role>

18、Web环境参数:env-entry元素声明Web应用的环境项

<env-entry>

<env-entry-name>minExemptions</env-entry-name>


本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-35381-8.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...