i have been trying store current view information in redis. when server goes down , again retrieve session info redis. manually create viewroot , set facescontext viewroot new one. still goes viewexpiredexception in restoreviewphase because viewroot null still.
this restore session info:
byte[] retrievedbytearray = redismanager.getconnection().hget((tms_ui_sessionid_ + providedsessionid + "bytearray").getbytes(), ("viewstateserializedobjectfromcontext").getbytes()); bytearrayinputstream bais = new bytearrayinputstream(retrievedbytearray); objectinputstream ois = null; try { ois = new objectinputstream(bais); serializable viewstate = null; try { viewstate = (serializable) ois.readobject(); } catch (classnotfoundexception e) { e.printstacktrace(); } uiviewroot viewroot = new uiviewroot(); viewroot.restorestate(facescontext.getcurrentinstance(), viewstate); viewroot.setrenderkitid(renderkitfactory.html_basic_render_kit); // viewroot.setviewid(.getviewid()); //what viewid put here??? facescontext.getcurrentinstance().setviewroot(viewroot); facescontext.getcurrentinstance().renderresponse();
where have tie in restored view information not go mentioned exception?
thanks
Comments
Post a Comment