私の JSF フォーム ログインはConstraint 1で動作していましたが、 Constraint 2を web.xmlに追加すると、フォームで送信すると jsf JavaScript ページに移動します。誰かが私が間違っていることを教えてもらえますか? これが簡単な設定ミスであることを願っています。
管理者のみが /admin/* ページにアクセスできるようにし、登録ユーザーのみが管理ファイルを含むサイト全体にアクセスできるようにしたいと考えています。ところで、Java スクリプト ページを表示した後でも、ブラウザーで目的のページに移動できますが、ユーザーに中間の js ページを表示したり、ターゲット ページの URL を知る必要はありません。
制約 1
<security-constraint>
<display-name>Admin</display-name>
<web-resource-collection>
<url-pattern>/admin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>ADMIN</role-name>
</auth-constraint>
</security-constraint>
制約 2
<security-constraint>
<display-name>Users</display-name>
<web-resource-collection>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>USER</role-name>
</auth-constraint>
</security-constraint>
リダイレクト先の望ましくない URL は次のとおりです。
javax.faces.resource/jsf.js.xhtml?ln=javax.faces&stage=Development
これが jsf.js.xhtml の始まりです... Firefox に表示されます
/**
@project JSF JavaScript Library
@version 2.0
@description This is the standard implementation of the JSF JavaScript Library.
*/
/**
* Register with OpenAjax
*/
if (typeof OpenAjax !== "undefined" &&
typeof OpenAjax.hub.registerLibrary !== "undefined") {
OpenAjax.hub.registerLibrary("jsf", "www.sun.com", "2.0", null);
}
// Detect if this is already loaded, and if loaded, if it's a higher version
if (!((jsf && jsf.specversion && jsf.specversion >= 20000 ) &&
(jsf.implversion && jsf.implversion >= 3))) {
...
Internet Explorer 8.0.7 では、このポップアップが表示されます
ノート
私は Firefox 10.0.4、IE 8.03、Glassfish 3.1、JSF2.0 lib、j_security_check を使用しており、ログイン レルムのセットアップはこれに似ています。