tomcat的j_security_check验证机制 是利用tomcat自身配置的角色和用户名来登录应用系统的
配置如下:
tomcat-users.xml
<role rolename="tomcat"/>
<role rolename="tian"/>
<role rolename="manager"/>
<user name="admin" password="admin" roles="tomcat,tian,manager" />
<user name="tian" password="tian" roles="tian,manager" />
web.xml
<!-- 首页 -->
<welcome-file-list>
<welcome-file>/index.jsp</welcome-file>
</welcome-file-list>
<security-constraint>
<web-resource-collection>
<web-resource-name>testLogin</web-resource-name>
<url-pattern>/index.jsp</url-pattern>
<http-method>GET</http-method>