0

该应用程序在 Firefox3.6 和所有版本的 IE 中运行良好。我下载了 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>

日志中没有错误消息。

4

2 回答 2

0

我仍然不知道您的问题,因为您没有提供有关您的环境和应用程序的太多详细信息。例如,您是否在登录页面中使用任何 javascript 或 ajax?标签之间是否有一些格式错误的标签?

就我而言,我使用的是 java-ee-5、JSF 2.0 框架(我的登录页面适用于 Firefox 3.6、Opera 11 和 IE8,但不适用于 Google Chrome)

这是我的工作登录页面(在 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 表单,它在Firefox 4.0.1中也适用于我,甚至比3.6.17 更好。

于 2011-06-06T17:12:13.543 回答
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 兼容的示例,例如从此处(为了尊重此处未复制的版权条件,请检查外部链接然后返回): 在此处输入链接描述

该登录表单声称与 Mozilla Firefox 4、Internet Explorer 8、Chrome 11、Safari 5、Opera 11 兼容。但我看不出它与我自己的有很大不同。

于 2011-06-13T19:46:08.833 回答