<user username='tomcat' password='tomcat'roles='tomcat'/>
<user username='role1' password='tomcat'roles='role1'/>
<user username='both' password='tomcat'roles='tomcat,role1'/>
<user username='lizongbo' password='lizongbopass'roles='admin,manager'/>
</tomcat-users>
有时在�TALINA_HOME%serverwebappsadminWEB-INFweb.xml里面也要做些修改
<!-- Security is active on entire directory -->
<security-constraint>
<display-name>Tomcat Server Configuration SecurityConstraint</display-name>
<web-resource-collection>
<web-resource-name>ProtectedArea</web-resource-name>
<!-- Define the context-relative URL(s) to be protected-->
<url-pattern>*.jsp</url-pattern>
<url-pattern>*.do</url-pattern>
<url-pattern>*.html</url-pattern>
</web-resource-collection>
<auth-constraint>
<!-- Anyone with one of the listed roles may access this area-->
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<!-- Login configuration uses form-based authentication-->
<login-config>
<auth-method>FORM</auth-method>
<realm-name>Tomcat Server Configuration Form-BasedAuthentication Area</realm-name>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/error.jsp</form-error-page>
</form-login-config>
</login-config>
<!-- Security roles referenced by this web application-->
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-28301-10.html
中国没有像样的民族工业
美军舰进入领海开始就有中军舰跟随证明它在来之前就已经被我们找到了
期待宋歌手