在从托管bean的页面加载期间设置jsf InputSecret的值 [英] Setting the value for jsf InputSecret during page load from the managed bean

查看:80
本文介绍了在从托管bean的页面加载期间设置jsf InputSecret的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个数据库设置jsf页面,该页面显示页面加载期间属性文件中的值.然后,用户更新页面,然后按Submit,属性文件中的值将更新.

I am creating a database setting jsf page which shows the value from the properties file during the page load. The users then updates the page and press submit and the value get updated in the properties file.

我遵循了Balusc提供的解决方案

I followed this solution provided by Balusc

在页面加载时调用JSF托管bean操作

并在支持bean的构造函数中设置值.

and set the value in the constructor of the backing bean.

  public DbSettingsBean()
  {        
    this.setUserName(helper.getValueForProperty("user_name"));
    this.setPassword(helper.getValueForProperty("password"));
  }

虽然我设法在页面加载期间显示了属性文件中的用户名.在页面加载期间,我无法显示密码的inputsecret值.它保持空白.

While I managed to show the user name from the properties file during page load. I am unable to show the value of inputsecret for password during the page load. It remains blank.

还有其他方法可以在页面加载期间显示密码吗?

Is there any other way to show password during page load?

我正在使用JSF RI 1.2和Richfaces 3.3.2

I am using JSF RI 1.2 and Richfaces 3.3.2

预先感谢

推荐答案

来打开它.

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

另请参见其

redisplay

标记,指示在创建表单时应呈现此字段中的任何现有值.由于存在潜在的安全风险,因此默认情况下不会显示密码值.

redisplay

Flag indicating that any existing value in this field should be rendered when the form is created. Because this is a potential security risk, password values are not displayed by default.

这篇关于在从托管bean的页面加载期间设置jsf InputSecret的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆