Handling HTTP session timeout and redirect in Eclipse RAP application -


i working on eclipse rap application (rcp web application). after servlet container has invalidated httpsession (session timeout, setmaxinactiveinterval exceeded) following exception thrown when clicking on application in browser:

java.lang.nullpointerexception @ org.eclipse.rap.rwt.internal.service.lifecycleservicehandler.service(lifecycleservicehandler.java:66) @ org.eclipse.rap.rwt.engine.rwtservlet.handlevalidrequest(rwtservlet.java:135) ... 

so implemented javax.servlet.filter detects situation , should redirect somewhere display "session timeout, please reload" message.

my preferred solution "session timeout" warning simple html5 page link application. don't know how integrate html5 pages rap application (and whether idea start with). not clear how , redirect should happen.

for redirecting tried 2 variations in filter. first 1 gives me "error: syntaxerror: json.parse: unexpected character @ line 1 column 1 of json data":

httpservletresponse.sendredirect("/myapp"); 

and 1 "java.lang.illegalstateexception: invalid thread access @ org.eclipse.rap.rwt.rwt.checkcontext(rwt.java:704)"

urllauncher launcher = rwt.getclient().getservice(urllauncher.class); launcher.openurl("http://www.eclipse.org/"); 

so going down wrong path here...

does know of standard way deal http session timeout situations in eclipse rap application?

is http session correct place deal this or should looking @ org.eclipse.rap.rwt.service.uisession, or else?

how can redirect home of application if lives on url "http://127.0.0.1:50045/myapp"?

can integrate simple html5 pages rap application (pages in same eclipse project, deployed in same war, available on same host)? or tedious task not come out of box?

first off, nullpointerexception should never happen during normal operations, please file bug including rap version , stacktrace.

just guess, problem may caused invalidating session within request processing. if case, may use httpsession method setmaxinactiveinterval small timeout instead.

the problem redirects rap application sends background (a.k.a. ajax) requests server , expects json responses in return. if filter redirects other page, rap client receives html page instead of json. in order redirect browser page, should send json response client includes redirect (see bug 388249):

{"head": {"redirect": "http://www.myurl.com/"}} 

to integrate other html5 pages in rap application, consider browser widget.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -