E
elliot.khazon
Hi all,
myfaces-impl-1.1.3 instantiates the request scope bean every request
(like it suppose to), however it doesn't retain any state information
about the bean even though t:saveState tag is specified.
When I use myfaces-impl it works just fine:
Here is how i use the bean.
Bean.java
---------------
private String value = "";
private int number = 0;
public Bean() {
}
getValue() {
return value;
}
setValue (String v) {
value = v;
..
..
..
initBean (int n)
number= n;
}
page.jsp
------------
<f:view>
<%
int number = req.getParameter ("number");
if (number != INVALID_VALUE) {
//if value wasn't invalid then init the bean
FacesContext facesCtxt = FacesContext.getCurrentInstance();
VariableResolver variableResolver =
facesCtxt.getApplication().getVariableResolver();
Bean myBean = (Bean) variableResolver.resolveVariable(
facesCtxt, "Bean" );
myBean.initBean (number);
}
%>
<t:saveState id="Bean" value="#{Bean}">
myfaces-impl-1.1.3 instantiates the request scope bean every request
(like it suppose to), however it doesn't retain any state information
about the bean even though t:saveState tag is specified.
When I use myfaces-impl it works just fine:
Here is how i use the bean.
Bean.java
---------------
private String value = "";
private int number = 0;
public Bean() {
}
getValue() {
return value;
}
setValue (String v) {
value = v;
..
..
..
initBean (int n)
number= n;
}
page.jsp
------------
<f:view>
<%
int number = req.getParameter ("number");
if (number != INVALID_VALUE) {
//if value wasn't invalid then init the bean
FacesContext facesCtxt = FacesContext.getCurrentInstance();
VariableResolver variableResolver =
facesCtxt.getApplication().getVariableResolver();
Bean myBean = (Bean) variableResolver.resolveVariable(
facesCtxt, "Bean" );
myBean.initBean (number);
}
%>
<t:saveState id="Bean" value="#{Bean}">