0

My app has a log in screen which looks as follows:

current state

When I run my app in field password there is one value as you can see on attached image. I am guessing this is coming form userController.password.

My question is what I have to do to get rid of this value so when I run my application I will see following outcome.

desired

I am using bootsfaces and the code this login form is as follows:

        <b:container>
        <h:form id="loginForm" class="form login-form">
            <b:container fluid="false">
                <b:panel title="login screen" look="primary">
                    <b:row>
                        <b:column medium-screen="2">
                            <h:outputText value="Username:"/>
                        </b:column>
                        <b:column medium-screen="4">
                            <b:inputText placeholder="Username" required="true" id="firstName" value="#{userController.firstName}">
                                <f:facet name="prepend">
                                    <b:icon name="user" />
                                </f:facet>
                            </b:inputText>
                        </b:column>
                        <b:column medium-screen="6">
                            <b:message for="firstName" />
                        </b:column>
                    </b:row>
                    <b:row>
                        <b:column medium-screen="2">
                            <h:outputText value="Password:" />
                        </b:column>
                        <b:column medium-screen="4">
                            <b:inputSecret placeholder="Password" type="password" id="password" value="#{userController.password}">
                                <f:facet name="prepend">
                                    <b:iconAwesome name="key" />
                                </f:facet>
                            </b:inputSecret>
                        </b:column>
                        <b:column medium-screen="6">
                            <b:message for="password" />
                        </b:column>
                    </b:row>
                    <b:row>
                        <b:column span="2" offset="2">
                            <b:commandButton value="login" action="#{userController.loginUser()}" update="@form" look="primary"
                                             style="width:100%" />
                        </b:column>
                    </b:row>
                </b:panel>
            </b:container>
        </h:form>
    </b:container>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
John Doe
  • 13
  • 3
  • 1
    It looks like there is a value in the password field of your controller. I don't think a space would get that output, but it seems like something is in there. Debug it with a print statement. – K.Nicholas Mar 07 '16 at 20:49
  • in my controller I have getter and setter for a password and that is it. I did changed the int to Integer to allows null values just for test and I got Null Pointer Exception on that field userController.password. So form that I am guessing that his is some kind of value assigned to int value. – John Doe Mar 07 '16 at 21:08
  • Wow, no one would expect a password field to be an integer. This explains everything (and you'd have exactly the same problem when using normal text input instead of a password input -- you would be seeing a zero). See the duplicate for the answer and the solution. – BalusC Mar 08 '16 at 07:39

0 Answers0