It happens in both IE and FireFox. Here's my code:
public String loginButton_action()
{
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
String loginName = (String) this.userNameTF.getText();
//lc.bind( ldapVersion, loginDN, password.getBytes("UTF8") );
String password = (String) this.passWordPF.getText();
//call Novell connect method to login to ldap.
try
{
// User u = NovellConnect.Connect(loginName, password);
//password.getBytes("UTF8");
Connect(loginName, password);
// display message if processing completes successfully
info("Hello " + this.userNameTF.getText() + ", you have been " +
"successfully authenticated.");
// Set the userName in SessionBean1
String userName = (String) userNameTF.getText();
getSessionBean1().setUserName(userName);
// Set the password in SessionBean1
String passWord = (String) passWordPF.getText();
getSessionBean1().setPassWord(passWord);
return "case1";
}//end try
catch (Exception e)
{
if (e.toString().equals("java.lang.SecurityException") || e.toString().equals("java.net.NoRouteToHostException"))
{
FacesContext facesContext = FacesContext.getCurrentInstance();
facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, " Problem connecting to Server. ", " "));
}// put some code in to warn user they are not authenticated.
else
{
System.out.println("error!" + e.toString());
}
// display message if processing completes unsuccessfully
info("Unsuccessful");
return "case2";
}
}
I am interested to know if you have to click twice before the login button's action method gets called or before the page will actually navigate to another page.
Can you put
log("action method called")
at the very top of your action method and look to see whether it shows up in the server log (right click the server node and choose view log to display output to the log) when you click the first button.
After you click the first button, wait a bit to allow time for the message to go to the log.