0

The applications works fine in Firefox3.6 ,all versions of IE. I downloaded Firefox 4 and tried to login. When I entered user name and password and click on submit button, It just clears the labels and when I hit on refresh button it submits the form. If I enter wrong userid and password it redirects to the error page.

<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>

There are no error messages in the logs.

tapps
  • 51
  • 2
  • 11

2 Answers2

0

I still have no clue about your problem as you do not give much details about your environment and application. Do you use any javascript or ajax in your login page for example? Do you have some mal formed tags between tags?

In my case, I am using java-ee-5, JSF 2.0 framework (My login page works in Firefox 3.6, Opera 11 and IE8 but not in Google Chrome)

Here is my working login page (tested on Firefox 3.6.17 and 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>

I used the same plain html form as you and it is working for me too in Firefox 4.0.1 and even better than 3.6.17.

Hanynowsky
  • 2,970
  • 5
  • 32
  • 43
0

I am also seeking an answer to this problem. I am developing a JavaEE6/JSF2 web application that runs inside Glassfish (first 3.0.1 and now 3.1).

The FORM based login was working fine on Firefox3.x versions, and still works fine on Safari5.0.5, but "fails silently" on both Firefox4.0.1 and on Google Chrome 12.0.742.91. (I am on Mac OS X and have not checked IE.)

It is very difficult to provide diagnostics since there are none.

Q: Are there any other logs or possible source of diagnostics I can switch on for Firefox and/or Google Chrome that might throw light in the subject ?

Here is my form:

 <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>

This is similar to examples shown elsewhere that are claimed to be compatible with Firefox 4, such as from here (to respect copyright conditions not copied here, please examine external link then return): enter link description here

That login form is claimed to be compatible with Mozilla Firefox 4, Internet Explorer 8, Chrome 11. Safari 5, Opera 11. But I can't see that it is very different from my own.

  • Well I just tested the one discussed at http://javaevangelist.blogspot.com/2011/06/jsf-2x-facelets-form-based.html which you can download from http://commondatastorage.googleapis.com/bluelotussoftware/code/jsf2-login.zip and it definitely worked for me in both Firefox4 and Google Chrome 12, but I can't see what the difference between his and mine is (other than the use of name instead of id in the form, which I tried in mine and did not work). – Webel IT Australia - upvoter Jun 13 '11 at 20:08
  • OK, I've found my problem; I was using a ui:composition template that had an outer h:form; the nested forms were failing on Firefox4 and Chrome12, but not other browsers. I fixed it be making a mini template without an outer h:form into which I can safely inject my login form. Although this is unlikely to apply in your case, you could check this to exclude the possibility of nested forms. – Webel IT Australia - upvoter Jun 13 '11 at 20:32