Hi there
I am trying to get through
JSF /PF tag for h:inputSecret but its not taking or displaying value. Please see the code snippet below
demo.xhtml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
>
<h:body>
<h1>JSF 2 password example</h1>
<h:form>
Password : <h:inputSecret value="#{userBean.password}" />
<h:commandButton value="Submit" action="user" />
</h:form>
</h:body>
</html>
user.xhtml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<h:body>
<h1>JSF 2 password example</h1>
Password : <h:outputText value="#{userBean.password}" />
</h:body>
</html>
UserBean
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.test;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;
import javax.inject.Named;
//@ManagedBean
@Named("userBean")
@SessionScoped
public class UserBean {
private
String password;
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
I am using JSF 2.2.
Thanks for info
Nek