java中的ispostback函数


public boolean isPostBack() {
FacesContext context = FacesContext.getCurrentInstance();
if (context.getResponseWriter() == null)
return false;
else
return true;
}



        public GoodsNewBean(){
goodsNewService=new GoodsNewServiceImpl();
if(isPostBack()){
init();
}
else{
goods=(Goods)this.getHttpSessionAttribute("goods");
}

}

你可能感兴趣的:(java)