Results 1 to 7 of 7

Thread: Pre-populate form:password

  1. #1
    Join Date
    Jun 2007
    Posts
    3

    Default Pre-populate form:password

    Hi,

    I have a form which sets the answer to various security questions, I need to be able to pre-populate the answer fields with a mask value, i.e. ******

    Unfortunately, when I use form:password, the value is not displayed - however, if I use form:input I can see the mask, but obviously, what I type into the form is not hidden...

    Is there anyway to pre-populate form:password fields? Or another way to achieve this?

    Cheers :)
    Last edited by chivas; Jun 8th, 2007 at 07:07 AM.

  2. #2
    Join Date
    Sep 2004
    Location
    Manchester, NH
    Posts
    1,236

    Default

    The form: password field will not render a value by default. You need to set the "showPassword" attribute on the tag:
    Code:
     <form:password ... showPassword="true" />
    Ref. docs: Link
    Is the password value to be shown? Defaults to false.
    Peter Mularien | Blog
    Author, Spring Security 3 (Book) - Packt Publishing, Available in print and eBook form
    SCJP 5, Oracle DBA
    Any postings are my own opinion, and should not be attributed to my employer or clients.


  3. #3
    Join Date
    Jun 2007
    Posts
    3

    Thumbs up Thanks!

    Thank you for the quick reply

  4. #4
    Join Date
    Sep 2004
    Location
    Manchester, NH
    Posts
    1,236

    Default

    I agree that it's not really clear in the tag documentation. It's clearer if you look at the source code for the tag itself.
    Peter Mularien | Blog
    Author, Spring Security 3 (Book) - Packt Publishing, Available in print and eBook form
    SCJP 5, Oracle DBA
    Any postings are my own opinion, and should not be attributed to my employer or clients.


  5. #5
    Join Date
    Jul 2007
    Posts
    5

    Default

    Hi
    when I'm using ShowPassword="true", I'v got this error:

    "Attribute showpassword invalid for tag password according to TLD"

    and I checked the TLD there is no attribute like showPassword.

    any idea where can I get the correct TLD?
    Thank you

  6. #6
    Join Date
    Nov 2005
    Location
    Reutlingen, Germany
    Posts
    2,098

    Default

    This seems to have been added only in Spring 2.0.3.

    Jörg

  7. #7

    Default

    Quote Originally Posted by Jörg Heinicke View Post
    This seems to have been added only in Spring 2.0.3.

    Jörg

    Hi,

    I am using this showPassowrd and i am able to get the masked password value in the password field. The problem to me here is when i open the view source of the page i am able to see the original password that what i entered.

    Can u please provide the solution to get the masked value in view source of the page as well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •