Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
vevkat2000
Post subject: please help...Icefaces inputSecret dooesn't work for me  PostPosted: Apr 01, 2009 - 03:20 PM
Veteran Member
Veteran Member


Joined: Nov 11, 2004
Posts: 3

This is really frustrating.I mean I wasted my whole sunday finding out why the " inputSecret " is not passing the value to the backing bean.It is always passing null to the backing bean.long story short,on a login screen , when you pass username and password nothings happens when you click the submit button...

I am using myeclipse 7.1.1 and icefaces 1.7.2....I have tried in so many scenarios but nothing worked for me.is this a bug in myeclipse or icefaces? .....any help would be really appreciated.

MyEclipse: 7.1.1
icefaces :1.7.2

I posted this in the icefaces forum,but was not of a much help.here is the link for the post in icefaces forum

http://www.icefaces.org/JForum/posts/list/12134.page

Here is the original code:


Code:
 <?xml version="1.0" encoding="ISO-8859-1" ?>
 <jsp:root version="1.2" xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:ice="http://www.icesoft.com/icefaces/component"
    xmlns:x="http://java.sun.com/jsp/jstl/xml">
    <jsp:directive.page contentType="text/html;charset=ISO-8859-1"
       pageEncoding="ISO-8859-1" />
    <f:view>
       <ice:outputDeclaration doctypeRoot="html"
          doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN"
          doctypeSystem="http://www.w3.org/TR/html4/loose.dtd" />
       <html>
          <head>
             <title>Home Page</title>
             <link rel="stylesheet" type="text/css"
                href="./xmlhttp/css/xp/xp.css" />
          </head>
          <body>
 
             <!--<f:loadBundle basename="com.attila.util.MessageBundle" var="bundle" />-->
 
             <ice:outputText value="Thank you for using Attila." />
 
             <ice:form id="loginForm" partialSubmit="true">
                <ice:panelGrid border="1" columns="2">
                   <ice:outputLabel for="userName">
                      <ice:outputText value="User Name" />
                   </ice:outputLabel>
                   <ice:inputText
                   action="#{UserBean.loginUser}"   value="#{UserBean.userName}"
                      id="userName">
                      <!--<f:validator validatorId="com.attila.web.jsf.validator.UserName" />-->
                   </ice:inputText>
                   <!--<ice:message for="userName"/>-->
                   <ice:outputLabel  for="password">
                      <ice:outputText value="Password" />
                   </ice:outputLabel>
                   <ice:inputSecret
                   action="#{UserBean.loginUser}"
                    id="password"></ice:inputSecret>
                    <!--<ice:message for="password" />-->
                   <ice:panelGroup>
                      
                   </ice:panelGroup>
                   <ice:commandButton value="Login" action="#{UserBean.loginUser}" id="submit" />
                </ice:panelGrid>
                <ice:messages />
             </ice:form>
          </body>
     </html>
    </f:view>
 </jsp:root>
Code:
 backing bean :i am pasting here only the action method
 
 
     public String loginUser() {     
        
         FacesContext facesContext = FacesContext.getCurrentInstance();
         
         if("myeclipse".equals(getUserName()) && "myeclipse".equals(getPassword())) {
            return"success";
         }
          FacesMessage facesMessage = new FacesMessage(
             "You have entered an invalid user name and/or password");
         facesContext.addMessage("loginForm", facesMessage);
         
         return "failure";
 }



Then people suggested so many ways but nothing worked for me.one of the solution was to add the actionListner to inputSecret,but didn't work either.Here is one of the suggestion I have tried with


Code:
 <?xml version="1.0" encoding="ISO-8859-1" ?>
 <jsp:root version="1.2" xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:ice="http://www.icesoft.com/icefaces/component"
    xmlns:x="http://java.sun.com/jsp/jstl/xml">
    <jsp:directive.page contentType="text/html;charset=ISO-8859-1"
       pageEncoding="ISO-8859-1" />
    <f:view>
       <ice:outputDeclaration doctypeRoot="html"
          doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN"
          doctypeSystem="http://www.w3.org/TR/html4/loose.dtd" />
       <html>
          <head>
             <title>Home Page</title>
             <link rel="stylesheet" type="text/css"
                href="./xmlhttp/css/xp/xp.css" />
          </head>
          <body>
 
             <!--<f:loadBundle basename="com.attila.util.MessageBundle" var="bundle" />-->
 
             <ice:outputText value="Thank you for using Attila." />
 
             <ice:form id="loginForm" partialSubmit="true">
                <ice:panelGrid border="1" columns="2">
                   <ice:outputLabel for="userName">
                      <ice:outputText value="User Name" />
                   </ice:outputLabel>
                   <ice:inputText
                   action="#{UserBean.loginUser}"   value="#{UserBean.userName}"
                      id="userName">
                      <!--<f:validator validatorId="com.attila.web.jsf.validator.UserName" />-->
                   </ice:inputText>
                   <!--<ice:message for="userName"/>-->
                   <ice:outputLabel  for="password">
                      <ice:outputText value="Password" />
                   </ice:outputLabel>
                   <ice:inputSecret
                   action="#{UserBean.loginUser}"
                    id="password"></ice:inputSecret>
                    <!--<ice:message for="password" />-->
                   <ice:panelGroup>
                      
                   </ice:panelGroup>
                   <ice:commandButton value="Login" action="#{UserBean.loginUser}" id="submit" />
                </ice:panelGrid>
                <ice:messages />
             </ice:form>
          </body>
     </html>
    </f:view>
 </jsp:root>
Code:
 backing bean :i am pasting here only the action method
 
 
     public String loginUser() {     
        
         FacesContext facesContext = FacesContext.getCurrentInstance();
         
         if("myeclipse".equals(getUserName()) && "myeclipse".equals(getPassword())) {
            return"success";
         }
          FacesMessage facesMessage = new FacesMessage(
             "You have entered an invalid user name and/or password");
         facesContext.addMessage("loginForm", facesMessage);
         
         return "failure";
 }
 


Please help me !!!!!!!!!
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
support-nipun
Post subject: RE: please help...Icefaces inputSecret dooesn  PostPosted: Apr 06, 2009 - 07:26 PM
Registered Member
Registered Member


Joined: Apr 18, 2007
Posts: 8013

Hi,
I just got a reply from the dev team and this seems like an ICEfaces issue. You will have to check with them on their forums.

_________________
Nipun
MyEclipse Support
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
ernestz
Post subject: RE: please help...Icefaces inputSecret dooesn  PostPosted: Apr 07, 2009 - 01:10 AM



Joined: Jan 04, 2007
Posts: 137

It looks like you are missing a 'value' attribute on your inputSecret tag (password), so the JSF Framework has nothing to 'set'.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits