Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RAP 1.5M4 Redirect using ProtocolMessageWriter
RAP 1.5M4 Redirect using ProtocolMessageWriter [message #769110] Wed, 21 December 2011 12:27 Go to next message
Farooq Kamal is currently offline Farooq KamalFriend
Messages: 40
Registered: January 2010
Location: Karachi, Pakistan
Member
Hi,

With RAP 1.5 M4 (full implementation of JSON), I cant figure out how to rewrite my existing redirect code for logging out

(with help from Stefan http://www.eclipse.org/forums/index.php/mv/msg/34206/110934/)

final String browserText =
MessageFormat.format("parent.window.location.href = \"{0}\";", urlToLoginPage);

final JavaScriptResponseWriter writer =
ContextProvider.getStateInfo().getResponseWriter();
writer.write(browserText);


The problem is JavaScriptResponseWriter has now been replaced with ProtocolMessageWriter and the code should be

final ProtocolMessageWriter writer =
ContextProvider.getStateInfo().getProtocolWriter();
writer.appendExecuteScript(String target, String scriptType, String code);

I'm looking for what to pass as target and scriptType. The ProtocolMessageWriter also has other methods which can be used but I guess this one should work.
Re: RAP 1.5M4 Redirect using ProtocolMessageWriter [message #769116 is a reply to message #769110] Wed, 21 December 2011 12:36 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 1872
Registered: July 2009
Senior Member
Hi,
use JSExecutor instead. This class is still internal but there is a bug
opened to make it public:
342995: Provide a public JSExecutor API
https://bugs.eclipse.org/bugs/show_bug.cgi?id=342995
HTH,
Ivan

On 12/21/2011 2:27 PM, Farooq Kamal wrote:
> Hi,
>
> With RAP 1.5 M4 (full implementation of JSON), I cant figure out how
> to rewrite my existing redirect code for logging out
>
> (with help from Stefan
> http://www.eclipse.org/forums/index.php/mv/msg/34206/110934/)
>
> final String browserText =
> MessageFormat.format("parent.window.location.href = \"{0}\";",
> urlToLoginPage);
>
> final JavaScriptResponseWriter writer =
> ContextProvider.getStateInfo().getResponseWriter();
> writer.write(browserText);
>
>
> The problem is JavaScriptResponseWriter has now been replaced with
> ProtocolMessageWriter and the code should be
>
> final ProtocolMessageWriter writer =
> ContextProvider.getStateInfo().getProtocolWriter();
> writer.appendExecuteScript(String target, String scriptType, String
> code);
>
> I'm looking for what to pass as target and scriptType. The
> ProtocolMessageWriter also has other methods which can be used but I
> guess this one should work.
>
Re: RAP 1.5M4 Redirect using ProtocolMessageWriter [message #769149 is a reply to message #769116] Wed, 21 December 2011 13:39 Go to previous message
Farooq Kamal is currently offline Farooq KamalFriend
Messages: 40
Registered: January 2010
Location: Karachi, Pakistan
Member
Thanks ... works fine!
Previous Topic:RAP 1.5M4 Redirect using ProtocolMessageWriter
Next Topic:dialog in firefox
Goto Forum:
  


Current Time: Thu Dec 18 15:36:20 GMT 2014

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

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