Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<h:inputSecret> becomes empty automatically even if i keep value in the back bean for it [duplicate]

Tags:

java

xhtml

jsf-2

becomes empty automatically even if i keep value in the back bean for it. I have already set the value for password in inputsecret variable in the back bean in jsf2 than also the input secret is being shown empty.

like image 680
deepmoteria Avatar asked Dec 14 '11 05:12

deepmoteria


1 Answers

This is indeed the default behaviour of <h:inputSecret> due to security reasons. You can get the value to redisplay anyway by setting the redisplay attribute to true.

<h:inputSecret value="#{bean.password}" redisplay="true" />

See also its view declaration language documentation (emphasis mine)

Encode Behavior

Render the clientId of the component as the value of the "name" attribute. Render the current value of the component as the value of the "value" attribute, if and only if the "redisplay" component attribute is the string "true". If the "styleClass" attribute is specified, render its value as the value of the "class" attribute.

like image 121
BalusC Avatar answered Sep 18 '22 23:09

BalusC