jsf - How to invoke @SessionScoped managed bean method on each page reload? -


my managed bean used @viewscoped , used @postconstruct annotated method situate various functions wanted performed each time page refreshed via browser url. however, page requires query string parameter processing , needed use ajax , redirect same page after ajax so, avoid reconcatenating query string params cache url string, changed scope @sessionscoped can do

facescontext.getcurrentinstance().getexternalcontext().redirect("mypage.jsf"); 

and session parameters need reloaded query string if @viewscoped stay there. however, problem @postconstruct method, among other things ok done @ start of session, make ejb call should executed on each page reload, regardless of scope. form submissions easy because call ejb method in managed bean method form submission calls problem doesn't run if user hits refresh in browser did in @viewscoped.

is there way me keep best of both scopes, iow retain processed query string params in cache without having reprocess them, @sessionscoped affords me while @ same time have method invoked on every page reload , not when managed bean lifecycle begins?

i understand go @viewscoped , reconcatenate query string params after mypage.jsf in code sample above seems manual. hoping there shortcut in jsf.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -