Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Eclipse RAP - UI-Session vs Http-Session
Eclipse RAP - UI-Session vs Http-Session [message #1752405] Mon, 23 January 2017 13:06 Go to next message
Aziz Hohenheim is currently offline Aziz HohenheimFriend
Messages: 12
Registered: November 2016
Junior Member
As far as I know, the UI-Session changes with each browser refresh whereas the Http-Session has the same identifier, even after a browser refresh.

Can anyone explain me what the diffrence between an Http-Session and UI-Session is?

Thanks in advance!
Best regards,
Nazar Medeiros
Re: Eclipse RAP - UI-Session vs Http-Session [message #1752598 is a reply to message #1752405] Wed, 25 January 2017 14:33 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2285
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
the RAP UISession is kept inside HTTPSession. As multiple browser tabs share the same HTTPSession, you can have more than one UISession (different RAP applications in every browser tab) inside one HTTPSession. See also [1].

[1] https://www.eclipse.org/rap/developers-guide/devguide.php?topic=scopes.html&version=3.1#uisession

Regards,
Ivan
Re: Eclipse RAP - UI-Session vs Http-Session [message #1752608 is a reply to message #1752598] Wed, 25 January 2017 15:19 Go to previous messageGo to next message
Christophe Becavin is currently offline Christophe BecavinFriend
Messages: 60
Registered: April 2011
Location: France
Member
Put this example code at the start of your first MPart to understand the concept of UISession and HttpSession

public void testApplicationContext(Shell shell){
	String sessionInfo = "";
	sessionInfo = RWT.getApplicationContext().toString()+"\n";
	sessionInfo += RWT.getClient().toString()+"\n";
	sessionInfo += RWT.getUISession().toString()+"\n";
	sessionInfo += RWT.getUISession().getHttpSession().toString()+"\n";
	System.out.println(sessionInfo);
	MessageDialog.openInformation(shell,"Session info",sessionInfo);
}

[Updated on: Wed, 25 January 2017 15:20]

Report message to a moderator

Re: Eclipse RAP - UI-Session vs Http-Session [message #1752870 is a reply to message #1752608] Mon, 30 January 2017 07:49 Go to previous messageGo to next message
Aziz Hohenheim is currently offline Aziz HohenheimFriend
Messages: 12
Registered: November 2016
Junior Member
Thanks for your help bros!

I appreciate your time =)

But to be honest.. I did not get the purpose of the UI-Session. Is this really necessary?

Aziz Hohenheim

[Updated on: Mon, 30 January 2017 07:55]

Report message to a moderator

Re: Eclipse RAP - UI-Session vs Http-Session [message #1752877 is a reply to message #1752870] Mon, 30 January 2017 08:48 Go to previous messageGo to next message
Christophe Becavin is currently offline Christophe BecavinFriend
Messages: 60
Registered: April 2011
Location: France
Member
If your website displays the same information no matter what the user is doing you don't need that.
If not, you need a user-instance session (UISession). It is most needed if you have to manage Singleton Java objects that can be shared within MParts.
Re: Eclipse RAP - UI-Session vs Http-Session [message #1752951 is a reply to message #1752877] Tue, 31 January 2017 08:50 Go to previous messageGo to next message
Aziz Hohenheim is currently offline Aziz HohenheimFriend
Messages: 12
Registered: November 2016
Junior Member
Hmm.. Sorry, I still did not get it Sad

For example:
I have a table displayed on the UI, which contains user information like firstname, lastname etc. The user is able to filter the table by entering a search string into a text field.

So I guess I need an UI-Session here because, I won't display always the same information. But what is exactly the task of the UI-Session?

Best regards,
Aziz
Re: Eclipse RAP - UI-Session vs Http-Session [message #1752955 is a reply to message #1752951] Tue, 31 January 2017 09:54 Go to previous messageGo to next message
Christophe Becavin is currently offline Christophe BecavinFriend
Messages: 60
Registered: April 2011
Location: France
Member
In fact the UISession and HTTPSession are really needed if you have java objects exchanged between MParts. I mean like "persistent" object, which is created at one point by the user and kept during his navigation.

For example, I have what we call a Singleton with some objects inside: String, int, ArrayList<String>,... These are created when the website open and kept until the user kill his session. If I put this Singleton in HttpSession, the objects will be shared by all users. If I put it in UISession, each user will have a different instance of these Singleton.

The best way to understand object creation and destruction is to install a local version of Apache Tomcat and screen the objects it creates using a software like JVM Memory Analyzer. Run your website, open two navigator (ex: Chrome and Firefox) and look how much objects have been instanciate in the JVM.

Good luck Smile
Re: Eclipse RAP - UI-Session vs Http-Session [message #1752956 is a reply to message #1752955] Tue, 31 January 2017 10:14 Go to previous message
Aziz Hohenheim is currently offline Aziz HohenheimFriend
Messages: 12
Registered: November 2016
Junior Member
Ah.. Now I understand. =) =) =)

Thanks a lot!!!
Previous Topic:How to change background style when loading home page
Next Topic:ServerPushSession and XML parsing error in Firefox
Goto Forum:
  


Current Time: Sun Aug 19 04:17:37 GMT 2018

Powered by FUDForum. Page generated in 0.02135 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top