Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8938129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:33:20+00:00 2026-06-15T10:33:20+00:00

I have a very strange error of password being displayed as label when form

  • 0

I have a very strange error of password being displayed as label when form validation fails on other form elements (not the password input textbox itself). The code for the view is below.

<s:if test="%{username == null}">
    <form method="post" enctype="multipart/form-data"
        action="manageUser_create.action">
</s:if>
<s:else>
<form method="post" enctype="multipart/form-data"
        action="manageUser_update.action">
</s:else>       
        <div>
            <s:textfield name="firstName" key="First Name"  cssClass="text-input" />
            <br class="clear" />                
            <s:textfield name="lastName" key="Last Name" cssClass="text-input" />
            <br class="clear" />                
            <s:file name="practiceLogo" id="practiceLogo" key="Upload Logo" cssClass="text-input" />
            <br class="clear" />
            <s:if test="%{username == null}">
                <s:textfield name="username" id="username"  key="Username" cssClass="text-input" />
                <br class="clear" />
            </s:if>
            <s:else>
                <s:hidden name="username"></s:hidden>
            </s:else>

            <s:password name="password"  key="Password" cssClass="text-input" />
            <br class="clear" />
            <s:textfield name="email" cssClass="text-input" key="Email Address" />                  
            <br class="clear" />
            <s:textfield name="replyToEmail" key="Reply To Email" cssClass="text-input" />                  
            <br class="clear" />
            <s:submit align="center" value="Save" id="submitButton" cssClass="btn btn-primary" />
        </div>
    </form>

The action uses annotation for validation as below –

@Validations(requiredStrings = {
        @RequiredStringValidator(type = ValidatorType.FIELD, shortCircuit=true, fieldName = "firstName", key = "opd.error.name.required"),
        @RequiredStringValidator(type = ValidatorType.FIELD, shortCircuit=true, fieldName = "lastName", key = "opd.error.name.required"),
        @RequiredStringValidator(type = ValidatorType.FIELD, shortCircuit=true, fieldName = "username", key = "opd.error.username.required"),
        @RequiredStringValidator(type = ValidatorType.FIELD, shortCircuit=true, fieldName = "password", key = "opd.error.password.required"),
        @RequiredStringValidator(type = ValidatorType.FIELD, shortCircuit=true, fieldName = "email", key = "opd.error.email.required"),
        @RequiredStringValidator(type = ValidatorType.FIELD, shortCircuit=true, fieldName = "replyToEmail", key = "opd.error.email.required")
        },
        emails = {          
        @EmailValidator(type = ValidatorType.FIELD, shortCircuit=true, fieldName = "email", key = "opd.error.email.format"),
        @EmailValidator(type = ValidatorType.FIELD, shortCircuit=true, fieldName = "replyToEmail", key = "opd.error.email.format")})
public String update() {

When I don’t enter password, the validation fails just like it should and then I see the correct message above the Password label and textbox. This works fine.

What does not work is if I enter password but leave out something else, like reply to email. Instead of the Password label being display, the password itself gets displayed where it should say “Password:”. For example, if the password is abcd, then abcd gets displayed as a label.

EDIT
This seems like a serious bug. If the attribute “key” of password is changed to anything other than Password or password, it gets displayed as the label.
Struts 2 version: 2.2.1

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:33:21+00:00Added an answer on June 15, 2026 at 10:33 am

    I found the workaround.

    Using the attribute “label” instead of “key” in the Password field fixes this issue.

    So

    <s:password name="password"  key="Password" cssClass="text-input" />
    

    needs to be changed to

    <s:password name="password" label="Password" cssClass="text-input" />
    

    Seems very strange though because all other fields work with key.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just started getting a very strange error when using jQueryMobile for my
it is very strange, because this error doesn't happen all the time... I have
I have an very strange error: when I want to use the SocialServer::Client class
I have a very strange error happening in an App that has been working
I have very strange error I can't understand. I started a new project throw
This error very strange. I have a bunch of properties in app delegate which
I have been confused by a very strange mex error just now . .
I have a very strange issue. I am not able to run a windows
I have a very strange error. I have an webpage that runs in Appmode
Very strange error, i have a field on an MVC View: <%: Html.CheckBox(Reportable, ViewData[Reportable])%>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.