|
Re: access RAP from servlet [message #513441 is a reply to message #513421] |
Wed, 10 February 2010 04:10 |
Rüdiger Herrmann Messages: 581 Registered: July 2009 |
Senior Member |
|
|
I assume that you don't actually need the UI thread but need to have
access the the session. If you really need the UI thread, options are
sparse.
In the latter case there are several ways to accomplish this:
* you may use an IServiceHandler instead of an extra servlet. That
provides you with a "context" which allows you to access
session-singletones etc. See JavaDoc, newsgroup, FAQ for further
information.
* you may put the information that needs to be shared among the
RWT-servlet and the charing-servlet in a session attribute. From RAP,
the http-session can be reached like this:
RWT.getSessionStore().getHttpSession().setAtribute()
HTH
--
Rüdiger Herrmann
http://eclipsesource.com
On 10.02.2010 08:21, Erdal Karaca wrote:
> I need to generate [birt] charts by calling a servlet.
>
> In RCP chart generation is done by generating/rendering on a SWT
> composite, in RAP an image is to be created.
>
> Unfortunately, the chart generation needs a ui thread, but accessing ui
> specific code from a servlet is not possible (ui context not available).
> Note: servlet runs on the same app server/jvm (embedded jetty).
>
> I solved this by starting a dummy ui session that registers its Display
> as a service that can be used in the servlet to execute ui specific code.
>
> Unfortunately, this does not seem to be a clean way of doing this task:
> Would you suggest some other ways?
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03729 seconds