Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to change timeout page
How to change timeout page [message #651340] Sat, 29 January 2011 09:43 Go to next message
evol is currently offline evol
Messages: 2
Registered: July 2009
Junior Member
Hi,
I just wonder how can I chage session timeout page. I guess it can be done by preserving "timeoutPage" in widget adapter. But there is a bit of confusion. The code of writeErrorPages method (org.eclipse.swt.internal.widgets.displaykit.DisplayLCA) is seems to always write predefined timeout page and do not use preserved value at all. Is there is some kind of trick that I do not understand or maybe it's just a misprint in variables names?
Here is a code of the method below:

private static void writeErrorPages( final Display display )
    throws IOException
  {
    String timeoutPage = getTimeoutPage();
    IWidgetAdapter adapter = DisplayUtil.getAdapter( display );
    Object newTimeoutPage = adapter.getPreserved( PROP_TIMEOUT_PAGE );
    if( !timeoutPage.equals( newTimeoutPage ) ) {
      String pattern
        = "org.eclipse.swt.Request.getInstance().setTimeoutPage( \"{0}\" );";
      Object[] param = new Object[] { newTimeoutPage };
      String jsCode = MessageFormat.format( pattern, param );
      IServiceStateInfo stateInfo = ContextProvider.getStateInfo();
      HtmlResponseWriter out = stateInfo.getResponseWriter();
      out.write( jsCode );
    }
  }

Re: How to change timeout page [message #652235 is a reply to message #651340] Thu, 03 February 2011 04:54 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1794
Registered: July 2009
Senior Member
Hi,
currently there is no public APIs to customize the timeout page. We are
aware of this and we are looking for a solution - see bug:
284422: Improve session timeout notification
https://bugs.eclipse.org/bugs/show_bug.cgi?id=284422
But... you can use an internal API to render your customize timeout page
- see the snippet below:
------------------------
String newTimeoutPage = "<html><body>My custom timeout page</body></html>";
String pattern
= "org.eclipse.swt.Request.getInstance().setTimeoutPage( \"{0}\"
);";
Object[] param = new Object[] { newTimeoutPage };
String jsCode = MessageFormat.format( pattern, param );
JSExecutor.executeJS( jsCode );
------------------------
Please consider, that this snippet uses internal APIs, both on client
and server, that are subject to change without notice!
HTH,
Ivan

On 1/29/2011 4:43 PM, evol wrote:
> Hi, I just wonder how can I chage session timeout page. I guess it can
> be done by preserving "timeoutPage" in widget adapter. But there is a
> bit of confusion. The code of writeErrorPages method
> (org.eclipse.swt.internal.widgets.displaykit.DisplayLCA) is seems to
> always write predefined timeout page and do not use preserved value at
> all. Is there is some kind of trick that I do not understand or maybe
> it's just a misprint in variables names?
> Here is a code of the method below:
>
> private static void writeErrorPages( final Display display )
> throws IOException
> {
> String timeoutPage = getTimeoutPage();
> IWidgetAdapter adapter = DisplayUtil.getAdapter( display );
> Object newTimeoutPage = adapter.getPreserved( PROP_TIMEOUT_PAGE );
> if( !timeoutPage.equals( newTimeoutPage ) ) {
> String pattern
> = "org.eclipse.swt.Request.getInstance().setTimeoutPage(
> \"{0}\" );";
> Object[] param = new Object[] { newTimeoutPage };
> String jsCode = MessageFormat.format( pattern, param );
> IServiceStateInfo stateInfo = ContextProvider.getStateInfo();
> HtmlResponseWriter out = stateInfo.getResponseWriter();
> out.write( jsCode );
> }
> }
>
Re: How to change timeout page [message #1003366 is a reply to message #652235] Sun, 20 January 2013 22:37 Go to previous messageGo to next message
Ronald So is currently offline Ronald So
Messages: 198
Registered: April 2011
Senior Member
Hi,

We may have a need to redirect to a separate HTML page when session times out. I found this thread and Bug 284422, but the fix is basically what I see in RAP 1.5. Does RAP support a customized HTML page for session timeout instead of the small pop up dialog box? We have a security concern because the error pop up simply puts on top of some potential sensitive data, and most of our customers are believed to want to remove these data from being shown on the screen when session times out.

Thanks!

Ronald
Re: How to change timeout page [message #1003502 is a reply to message #1003366] Mon, 21 January 2013 06:29 Go to previous message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1290
Registered: July 2009
Senior Member

Hi Ronald,

292607 is your bug. I guess this is something we should consider for RAP
2.1. Until the bug is fixed, you may can find a hack based on the fix
for bug 388249?

HTH, Ralf


--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:RAP 2.0 War deployment issue
Next Topic:View drag and drop
Goto Forum:
  


Current Time: Sat Aug 30 02:41:14 EDT 2014

Powered by FUDForum. Page generated in 0.07393 seconds