aspose file tools*
The moose likes JSF and the fly likes Dynamic control of textbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Dynamic control of textbox" Watch "Dynamic control of textbox" New topic
Author

Dynamic control of textbox

Avik Mazunder
Ranch Hand

Joined: Jun 27, 2012
Posts: 39

I want to change the border colour of textbox if someone enter wrong password....Is there any method for changing border colour dynamically??
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16058
    
  21

Yes. Add a "styleClass" attribute to the control and make its value be an EL expression based on whether the password is right, empty, or wrong.

Although actually telling someone that their password specifically is wrong is considered bad security practice if the password is being combined with other security tokens such as userIDs. In such cases, the recommended response is simply to indicate that one or more of the tokens is invalid. Otherwise, hackers know which tokens they have that work and don't need to do as much work to find the values of the remaining tokens.


Customer surveys are for companies who didn't pay proper attention to begin with.
Avik Mazunder
Ranch Hand

Joined: Jun 27, 2012
Posts: 39

Tim Holloway wrote:Yes. Add a "styleClass" attribute to the control and make its value be an EL expression based on whether the password is right, empty, or wrong.


Can you give me an example please??
Thanks
Cesar Alforde
Greenhorn

Joined: Feb 21, 2009
Posts: 3

when you keep a secret, the less information you give is the better, if you say "you password is wrong" at the same time the hacker says "ahh but the username is correct!" , then he just have to find the right password not both, or he can use this info that you leaked to find more usernames. For this reason is better just to say "Username or password incorrect"

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic control of textbox