Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to set RWT.getApplicationContext() in java thread.
How to set RWT.getApplicationContext() in java thread. [message #1758782] Sun, 02 April 2017 21:17 Go to next message
Cho HyunJong is currently offline Cho HyunJongFriend
Messages: 90
Registered: July 2009
Location: korea
Member

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 Go to previous message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 206
Registered: February 2011
Senior Member
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.
Previous Topic:theming opacity button checkbox
Next Topic:How to get the cell for Nebula grid mouse events?
Goto Forum:
  


Current Time: Sat Oct 20 14:59:26 GMT 2018

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

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

Back to the top