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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With