tomcat为:4.1.10
web.xml里如下:
<security-constraint> <web-resource-collection> <web-resource-name>Edit Department</web-resource-name> <url-pattern>/editDepartment.do</url-pattern> </web-resource-collection> <web-resource-collection> <web-resource-name>Update Department</web-resource-name> <url-pattern>/updateDepartment.do</url-pattern> </web-resource-collection> <auth-constraint> <role-name>department</role-name> </auth-constraint> </security-constraint>
<login-config> <auth-mothod>FORM</auth-mothod> <form-login-config> <form-login-page>/login.jsp</form-login-page> <form-error-page>/login.jsp</form-error-page> </form-login-config> </login-config> <security-role> <role-name>department</role-name> </security-role>
|
如果没有 <security-role> 则出现以下错误:2003-07-01 14:33:39 ContextConfig[/wuxihuaxia]: WARNING: Security role name department used in an <auth-constraint> without being defined in a <security-role>
加上<security-role>后也没用
以上两种情况,tomcat的控制台都会自动关闭掉,所以没法看到具体的错误消息!
我是用的JDBCRealm,数据库为mysql数据库(mysql-3.23.55)