各位高手好,小弟在jsp登陆页面中采用form表单验证,并且在tomcat的tomcat-uers.xml文件中进行了用户和角色的配置,根据自己在tomcat-users.xml文件中设置的user和password登陆,但是一直失败。
想问问各位还需配置哪些地方,殷切等待中……
[color=blue][b]
我按照上述的配置,测试成功!
请检查以下几点:
1、tomcat的tomcat-users.xml中配置是否正确?
2、Form表单的action、name字段是否正确?
3、web.xml中的角色是否配置正确?
[/b][/color]
[b]你的Form是如何写的?[/b]
[code="html"]
Enter the username: | |
Enter the password: | |
[b]web.xml的配置呢?[/b]
[code="xml"]
JSP database component
/index.jsp
<auth-constraint>
<role-name>tomcat</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/1.jsp</form-login-page>
<form-error-page>/2.jsp</form-error-page>
</form-login-config>
</login-config>[/code]
[b]用户的配置,是Tomcat默认的。[/b]