This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information

Session handling in VisionX Webapp

General questions regarding the development with JavaFX UI for JVx.

Session handling in VisionX Webapp

Postby loknath » Mon Aug 19, 2019 8:36 am

Hi I wanted to save some attribute in session and then i am redirecting to google for authorization(https://www.googleapis.com/oauth2/v1/userinfo). Later from saved attribute i want to perform some more task.

Code: Select all
HttpContext hctxt = HttpContext.getCurrentInstance();
Object request = hctxt.getRequest();
   
//final GoogleAuthHelper helper = new GoogleAuthHelper();
if(((ServletRequest) request).getParameter("code") != null && ((ServletRequest) request).getParameter("state") != null)
{
    if (request instanceof HttpServletRequest)
    {
        tmp = ((HttpServletRequest)request).getHeader("User-Agent");
        tmpsession = ((HttpServletRequest)request).getSession().getId();
        System.out.println(tmp + "/br " + tmpsession);
        //helper.getUserInfoJson(tmpsession);
     }
}
loknath
 
Posts: 5
Joined: Tue Jul 23, 2019 10:31 am

Re: Session handling in VisionX Webapp

Postby Support@SIB » Mon Aug 19, 2019 10:35 am

Simply put your properties into the launcher. Set preserve on refresh enabled.The application is saved in the http session and your properties are available in your application.
User avatar
Support@SIB
 
Posts: 353
Joined: Mon Sep 28, 2009 1:56 pm

Re: Session handling in VisionX Webapp

Postby loknath » Mon Aug 19, 2019 12:00 pm

Do we have any sample tutorials or code to do same. I am new to VisionX :?:
loknath
 
Posts: 5
Joined: Tue Jul 23, 2019 10:31 am

Re: Session handling in VisionX Webapp

Postby Support@SIB » Fri Aug 23, 2019 12:15 pm

The preserveOnRefresh is documented here.

With VisionX, use the Web application settings wizard to set this feature.
User avatar
Support@SIB
 
Posts: 353
Joined: Mon Sep 28, 2009 1:56 pm

Re: Session handling in VisionX Webapp

Postby Support@SIB » Mon Aug 26, 2019 11:54 am

To put custom properties, use following documentation.
User avatar
Support@SIB
 
Posts: 353
Joined: Mon Sep 28, 2009 1:56 pm


Return to Development