我正在关注tutorial进行单点登录。
我的web.xml如下所示。
<servlet>
<servlet-name>secret</servlet-name>
<servlet-class>com.tomcat.demo.SalaryServer</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>secret</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>
<security-constraint>
<web-resource-collection>
<web-resource-name>SecretProtection</web-resource-name>
<url-pattern>/servlet/SalaryServer</url-pattern>
<url-pattern>/servlet/secret</url-pattern>
<url-pattern>/test</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>
FORM
<!-- BASIC, DIGEST, FORM, CLIENT-CERT -->
</auth-method>
<form-login-config>
<!-- only useful for FORM -->
<form-login-page>/loginpage.html</form-login-page>
<form-error-page>/errorpage.html</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>admin</role-name>
</security-role>
</web-app>
即使我使用正确的登录,它也会进入错误页面。请告诉我这是什么问题?
答案 0 :(得分:0)
通过将安全域设置为jboss-web.xml
中的其他域来解决该问题