myfaces-impl-1.1.3 instantiates the request scope bean

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}">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top