1
我有一个Web应用程序设置为在每个输入点提示输入用户名和密码。除了一个名为showStatus
的URL之外,一切都需要基本身份验证,其目的是显示应用程序的状态。 showStatus
URL不需要认证。问题是,即使访问showStatus
URL,密码对话框仍然显示。我可以点击取消,或者点击确定,仍然可以访问该页面,但我想知道如何禁用showSession
URL的对话框。Glassfish 3.1登录域不应提示输入特定URL的凭据
这里是web.xml
内容:
<!-- constraint for restricted pages -->
<security-constraint>
<display-name>restricted access</display-name>
<web-resource-collection>
<web-resource-name>Secure Pages</web-resource-name>
<description/>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<description/>
<role-name>USERS</role-name>
</auth-constraint>
</security-constraint>
<!-- do not require authentication for showStatus URL -->
<security-constraint>
<web-resource-collection>
<web-resource-name>ShowStatus</web-resource-name>
<url-pattern>/showStatus.action</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
</security-constraint>
<!-- need the login prompt to appear for everything but showStatus -->
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>MYREALM</realm-name>
</login-config>
<security-role>
<role-name>USERS</role-name>
</security-role>
我仍无法解决此问题。谁能帮忙? – gsjava 2012-03-20 13:24:43
回到你自己的步骤,你可能在配置中也限制了该页面。也许这个链接可以帮助你: http://javing.blogspot.in/2012/05/here-in-this-video-you-can-see-how-i.html – sfrj 2012-05-01 23:27:49