コード例 #1
0
ファイル: GSS.java プロジェクト: davideuler/gss
 /** Clear the cookie and redirect the user to the logout page. */
 void logout() {
   Configuration conf = (Configuration) GWT.create(Configuration.class);
   String cookie = conf.authCookie();
   String domain = Window.Location.getHostName();
   String path = Window.Location.getPath();
   Cookies.setCookie(cookie, "", null, domain, path, false);
   String baseUrl = GWT.getModuleBaseURL();
   String homeUrl = baseUrl.substring(0, baseUrl.indexOf(path));
   Window.Location.assign(homeUrl + conf.logoutUrl());
 }
コード例 #2
0
  /**
   * redirect unauthorized calls to login
   *
   * <p>TODO method.getResponse() is not equal to response. unfortunately
   */
  @Override
  public RequestCallback filter(
      final Method method, final Response response, RequestCallback callback) {
    if (LogConfiguration.loggingIsEnabled()) {
      Logger.getLogger(FilterawareRetryingCallback.class.getName())
          .severe("Unauthorized: " + method.builder.getUrl());
    }
    Window.Location.assign(target + Window.Location.getQueryString());

    // useless return, anyway
    return callback;
  }
コード例 #3
0
ファイル: GSS.java プロジェクト: davideuler/gss
 /** Redirect the user to the login page for authentication. */
 protected void authenticateUser() {
   Configuration conf = (Configuration) GWT.create(Configuration.class);
   Window.Location.assign(
       GWT.getModuleBaseURL() + conf.loginUrl() + "?next=" + GWT.getModuleBaseURL());
 }
コード例 #4
0
 private void download() {
   Window.Location.assign("/downloadDocument.html?id=" + documentId);
 }
コード例 #5
0
 @UiHandler("btnReport")
 void onReportClick(ClickEvent event) {
   String reportServiceUrl = GWT.getModuleBaseURL() + resolveReportParamString();
   Window.Location.assign(reportServiceUrl);
 }