I have a project in JSF, I try to use @ Inject to use variables from a JSF page on another JSF page. I have a main JSF Entity, in which I use the @Inject and a method to send these variables. So here's the code:
@Inject private updateDominio update;
public void actualizar(ActionEvent actionEvent) {
dominio = (TblDominios)getDataTable1().getRowData();
update = new updateDominio();
update.setDominio(dominio);
try {
FacesContext.getCurrentInstance().getExternalContext().redirect("updateDominio.xhtml");
} catch (IOException e) {
}
}
In the other hand, here's the destination entity:
@Named
@ManagedBean
@Scope("session")
public class updateDominio {
private TblDominios dominio;
public updateDominio() {
//super();
//this.dominio = new TblDominios();
System.out.println(dominio);
}
public void setDominio(TblDominios dominio) {
this.dominio = dominio;
System.out.println(dominio);
}
public TblDominios getDominio() {
return dominio;
}
}
My problema is that in the method setDominio they arrive the values of the another Entity, but when i use this values in the JSF:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"></meta>
</head>
<body>
<h:form>
<h:outputLabel value="Nombre"/>
<h:inputText value="#{updateDominio.dominio.strDescripcion}"/>
</h:form>
</body>
This doesn't display anything, I don't know what happen. thank you for you help.
I'm sorry for my bad english :c