2007年1月4日 星期四

security-constraint - tomcat

Security Constraint 是 tomcat 一種有趣的設定方式,
這是tomcat 他 container 內建的安全機制。
使用預設BASIC的可以是

<security-constraint>
<display-name>Security constarint</display-name>
<web-resource-collection>
<web-resource-name>Java Application</web-resource-name>
<url-pattern>/folder/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>tomcat</role-name>
</auth-constraint>
</security-constraint>

<login-config>
<auth-method>BASIC</auth-method>
<realm-name>OnJava Application</realm-name>
</login-config>


登入利用tomcat-users.xml

沒有留言: