|
|
Re: Eclipse RAP - UI-Session vs Http-Session [message #1752608 is a reply to message #1752598] |
Wed, 25 January 2017 15:19 |
Eclipse User |
|
|
|
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] by Moderator 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 |
Eclipse User |
|
|
|
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 #1752955 is a reply to message #1752951] |
Tue, 31 January 2017 09:54 |
Eclipse User |
|
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03646 seconds