How to set RWT.getApplicationContext() in java thread. [message #1758782] |
Sun, 02 April 2017 21:17  |
Eclipse User |
|
|
|
I have created a pure bundle with no UI.
I want to do RWT.getApplicationContext().setAttribute(xx, xxx).
I wrote.
Display display = Display.getCurrent ();
If (display == NULL) display = Display.getDefault ();
Display.asyncExec (new Runnable () {
@Override
Public void run () {
Logger.debug ("====> debug --->");
ApplicationContext context = RWT.getApplicationContext ();
Context.setAttribute (PublicTadpoleDefine.GATEWAY_DB_LIST, mapExtension);
}
});
but display object is null.
How can I set RWT.getApplicationContext () on a Thread without a UI?
Thanks.
ps) i attach java file.
|
|
|
Re: How to set RWT.getApplicationContext() in java thread. [message #1758857 is a reply to message #1758782] |
Mon, 03 April 2017 20:54  |
Eclipse User |
|
|
|
If you have access to the ServletContext, there is an internal static method that will return the ApplicationContext
org.eclipse.rap.rwt.internal.application.ApplicationContextImpl.getFrom(ServletContext)
Perhaps if you can convince the RAP maintainers of a use case for this, they might add a public API method.
At a minimum you're going to require a reference to the ServletContext, since there can be many RAP applications running in an application server.
|
|
|
Powered by
FUDForum. Page generated in 0.03422 seconds