I have 2 @SessionScoped
beans in my small application. Even when I restart of clean the server, all of the form values are retained.
@ManagedBean(name = "bill")
@SessionScoped
public class Bill implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private static final String MANAGED_BEAN_NAME = "bill";
/**
* @return the current instance of Bill
*/
public static Bill getCurrentInstance() {
return (Bill) FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().get(MANAGED_BEAN_NAME);
}
//other methods
}
@ManagedBean
@SessionScoped
public class TailorTip implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private Bill bill;
private Participants[] participants;
private Integer participantIndex;
@PostConstruct
public void init() {
bill = Bill.getCurrentInstance();
}
//other methods
}
How do I avoid the retention of values? Note: I use tomcat.