2011-05-09 75 views
0

這些應用程序在IE3的所有版本的Firefox3.6中都能正常工作。我下載了Firefox 4並嘗試登錄。當我輸入用戶名和密碼並單擊提交按鈕時,它只是清除標籤,當我點擊刷新按鈕時,它會提交表單。如果我輸入錯誤的用戶名和密碼,它會重定向到錯誤頁面。J_scurity_check在Firefox中失敗4

<form method="POST" action="j_security_check"> 
    Username: <input type="text" name="j_username"> <br/> 
    Password: <input type="password" name="j_password"> 
    <input type="submit" value="Login"> 
</form> 

日誌中沒有錯誤消息。

回答

0

我仍然不知道你的問題,因爲你沒有提供關於你的環境和應用的更多細節。例如,您是否在登錄頁面使用任何javascript或ajax?標籤之間是否有一些錯誤形成的標籤?

就我而言,我使用的Java EE-5,JSF 2.0框架(我的登錄頁面,在Firefox 3.6,歌劇11和IE8,但不是在谷歌瀏覽器)

這是我工作的登錄頁面(在Firefox 3.6.17和4.0.1上測試)。

<?xml version='1.0' encoding='UTF-8' ?> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:p="http://primefaces.prime.com.tr/ui" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:o="http://openfaces.org/"> 
     <h:head> 
      <div align="center"> 
       <h:outputText value="Logon" 
           style="text-align: center;font-weight: bolder"/> 
       <br /> 
      </div> 
      <h:outputStylesheet name="css/style.css"/> 
      <link rel="icon" href="#{resource['images/diagnostic.ico']}" type="image/x-icon"/> 
      <link rel="shortcut icon" href="#{resource['images/diagnostic.ico']}" type="image/x-icon"/> 
     </h:head> 
     <h:body style="font-weight: lighter;background: url(#{resource['images/master-bg.jpg']});background-repeat: repeat;"> 
    <h:form id="logonform" onsubmit="document.logonform.action = 'j_security_check';"> 
         <p:panel header="#{bundle.Login}" style="font-weight: lighter"> 
          <h:panelGrid columns="2"> 
           <h:outputLabel for="j_username" value="#{bundle.Username}" style="font-weight: bold;"/> 
           <input id="usernameid" type="text" name="j_username" /> 

           <h:outputLabel for="j_password" value="#{bundle.Password}" style="font-weight: bold;"/> 

           <input type="password" name="j_password" /> 
           <h:outputText value="" /> 
           <h:panelGrid columns="2"> 
            <p:commandButton value="Connexion" type="submit" ajax="false"/> 
            <p:button outcome="Logon" value="Cancel" /> 
           </h:panelGrid> 
          </h:panelGrid> 
         </p:panel> 
        </h:form> 
    </h:body> 
    </html> 

我用同樣的純HTML形式,你和它在火狐4.0.1工作對我來說,比3.6.17甚至更好。

0

我也在尋求這個問題的答案。我正在開發在Glassfish內部運行的JavaEE6/JSF2 Web應用程序(第一個3.0.1和現在的3.1)。

基於FORM的登錄在Firefox3.x版本上工作正常,在Safari5.0.5上仍然正常工作,但在Firefox4.0.1和Google Chrome 12.0.742.91上「靜靜地失敗」。 (我在Mac OS X上並沒有檢查過IE。)

由於沒有提供診斷信息,所以很難提供診斷信息。

問:是否有任何其他日誌或診斷的可能來源,我可以在Firefox和/或Google Chrome上打開可能會導致此問題的燈光?

這是我的形式:

<form id="loginForm" method="POST" action="j_security_check"> 

<h:panelGrid columns="3" styleClass="login" columnClasses="login-label, login-field"> 
<h:outputLabel for="j_username">Username:</h:outputLabel> 
<h:inputText id="j_username" required="true" /> 
<h:message for="j_username" /> 

<h:outputLabel for="j_password">Password:</h:outputLabel> 
<h:inputSecret id="j_password" required="true" /> 
<h:message for="j_password" /> 

<h:outputLabel for="login_button"></h:outputLabel> 
<h:commandButton id="login_button" value="Login" /> 
</h:panelGrid> 

這類似於別處所示的例子中被聲稱是與Firefox 4兼容,諸如從這裏(尊重這裏不復製版權的條件下,請檢查外部鏈接,然後返回): enter link description here

該登錄表單聲稱與Mozilla Firefox 4,Internet Explorer 8,Chrome 11兼容。Safari 5,Opera 11.但我無法看到它與我自己完全不同。

+0

那麼我剛剛測試了一個在http://javaevangelist.blogspot.com/2011/06/jsf-2x-facelets-form-b​​ased.html上討論過的,你可以從http://commondatastorage.googleapis.com下載。 /bluelotussoftware/code/jsf2-login.zip,它在Firefox4和Google Chrome 12中都可以爲我工作,但是我看不到他和我的區別是什麼(除了在名稱中使用name而不是id)形式,我在我的嘗試,並沒有工作)。 – 2011-06-13 20:08:42

+0

好的,我發現我的問題;我使用的是具有外部h:形式的ui:組合模板;嵌套表單在Firefox4和Chrome12上失敗,但沒有其他瀏覽器。我將它固定爲製作一個沒有外部h:form的迷你模板,我可以安全地注入登錄表單。儘管這種情況不太可能適用於您的情況,但您可以檢查這一點以排除嵌套表單的可能性。 – 2011-06-13 20:32:36