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