com.google.gwt.core.client.GWT.getHostPageBaseURL()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(238)

本文整理了Java中com.google.gwt.core.client.GWT.getHostPageBaseURL()方法的一些代码示例,展示了GWT.getHostPageBaseURL()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GWT.getHostPageBaseURL()方法的具体详情如下:
包路径:com.google.gwt.core.client.GWT
类名称:GWT
方法名:getHostPageBaseURL

GWT.getHostPageBaseURL介绍

[英]Gets the URL prefix of the hosting page, useful for prepending to relative paths of resources which may be relative to the host page. Typically, you should use #getModuleBaseURL() unless you have a specific reason to load a resource relative to the host page.
[中]获取宿主页的URL前缀,该前缀用于预加资源的相对路径,这些资源可能是相对于宿主页的。通常,您应该使用#getModuleBaseURL(),除非您有特定的理由加载相对于主机页的资源。

代码示例

代码示例来源:origin: libgdx/libgdx

public String getPreloaderBaseURL()
{
  return GWT.getHostPageBaseURL() + "assets/";
}

代码示例来源:origin: libgdx/libgdx

public String getPreloaderBaseURL()
{
  return GWT.getHostPageBaseURL() + "assets/";
}

代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-gwt

public String getPreloaderBaseURL()
{
  return GWT.getHostPageBaseURL() + "assets/";
}

代码示例来源:origin: com.progressoft.brix.domino/vertx-domino-event-bus-frontend

@Override
public String getHostUrl() {
  return GWT.getHostPageBaseURL();
}

代码示例来源:origin: net.wetheinter/xapi-components

protected String getPolyfillUrl() {
 return GWT.getHostPageBaseURL() + "x-tag-components.min.js";
}

代码示例来源:origin: org.eagle-i/eagle-i-datatools-sweet-gwt

private static String getBaseUrl() {
    String url = GWT.getHostPageBaseURL();
    url = url.substring( 0, url.length() - 1 ); // strip last /
    url = url.substring( 0, url.lastIndexOf( '/' ) ); // strip module name
    return url;
  }
}

代码示例来源:origin: net.sf.javaprinciples.client/client-presentation

@Deprecated
protected boolean redirectHack(String text)
{
  if (text != null && text.contains("<!-- ##Login page hack## -->"))
  {
    String redirectUrl = GWT.getHostPageBaseURL() + "Login.html?login-reauth";
    Window.Location.replace(redirectUrl);
    return true;
  }
  return false;
}

代码示例来源:origin: org.geomajas.project/geomajas-project-sld-editor-expert-common

@Inject
public SldManagerImpl(EventBus eventBus) {
  this.eventBus = eventBus;
  ServiceDefTarget endpoint = (ServiceDefTarget) service;
  endpoint.setServiceEntryPoint(GWT.getHostPageBaseURL() + "d/sldTemplates");
}

代码示例来源:origin: imrabti/gwtp-spring-security

@Provides
  @RestApplicationPath
  String getApplicationPath() {
    String baseUrl = GWT.getHostPageBaseURL();
    if (baseUrl.endsWith("/")) {
      baseUrl = baseUrl.substring(0, baseUrl.length() - 1);
    }

    return baseUrl;
  }
}

代码示例来源:origin: gwt-test-utils/gwt-test-utils

private static URL getURLToUse() {
  if (urlHolder.url == null) {
    try {
      urlHolder.url = new URL(GWT.getHostPageBaseURL() + computePath() + Location.getHash());
    } catch (MalformedURLException e) {
      throw new GwtTestConfigurationException(
          "GWT.getHostPageBaseURL() has failed to be parsed in a " + URL.class.getName()
              + " instance", e);
    }
  }
  return urlHolder.url;
}

代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils

private static URL getURLToUse() {
  if (urlHolder.url == null) {
    try {
      urlHolder.url = new URL(GWT.getHostPageBaseURL() + computePath() + Location.getHash());
    } catch (MalformedURLException e) {
      throw new GwtTestConfigurationException(
          "GWT.getHostPageBaseURL() has failed to be parsed in a " + URL.class.getName()
              + " instance", e);
    }
  }
  return urlHolder.url;
}

代码示例来源:origin: org.n52.sensorweb/sensorwebclient-ui

public void onClick(ClickEvent event) {
    String helpUrl = GWT.getHostPageBaseURL() + i18n.helpPath();
    Window.open(helpUrl, "", "");
  }
});

代码示例来源:origin: org.n52.sensorweb/sensorwebclient-ui

public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
    String helpUrl = GWT.getHostPageBaseURL() + i18n.helpPath();
    Window.open(helpUrl, "", "");
  }
});

代码示例来源:origin: org.n52.sensorweb/sensorwebclient-ui

public void onClick(ClickEvent event) {
    String helpUrl = GWT.getHostPageBaseURL();
    highlightSelectedButton(helpButton);
    if (PropertiesManager.language.equals("en")) {
      Window.open(helpUrl + "help_ses_en.html", "help", "");
    } else {
      Window.open(helpUrl + "help_ses_de.html", "help", "");
    }
  }
});

代码示例来源:origin: org.kuali.student.core/ks-common-ui

@Override
public void onSuccess(String result) {
  // On success get documentID back from GWT Servlet//
  
  // We need to get the base url and strip the gwt module name . 
  String baseUrl = GWT.getHostPageBaseURL();
  baseUrl = baseUrl.replaceFirst(GWT.getModuleName() + "/", "");                    	                    
  
  KSBlockingProgressIndicator.removeTask(loadDataTask);
  
  Window.open(baseUrl + "exportDownloadHTTPServlet?exportId="+result + "&format=" + format, "", "");                          
}

代码示例来源:origin: org.uberfire/uberfire-runtime-plugins-client

@Override
  public void execute() {
    form.setAction(GWT.getHostPageBaseURL().replaceAll("/" + GWT.getModuleName(),
                              "") + pluginConfigService.getMediaServletURI() + pluginName);
    form.submit();
  }
},

代码示例来源:origin: kiegroup/appformer

@Override
  public void execute() {
    form.setAction(GWT.getHostPageBaseURL().replaceAll("/" + GWT.getModuleName(),
                              "") + pluginConfigService.getMediaServletURI() + pluginName);
    form.submit();
  }
},

代码示例来源:origin: fr.putnami.pwt/pwt

private DefaultCommandController() {
  this.moduleBaseURL = GWT.getHostPageBaseURL();
  this.remoteServiceURL = this.moduleBaseURL + "commandService";
  ErrorManager.get().registerErrorHandlers(new ClientErrorHandler(), new ServerErrorHandler(),
    new DefaultCommandExceptionErrorHandler());
}

代码示例来源:origin: org.n52.sensorweb/sensorwebclient-ui

public void onSuccess(RepresentationResponse result) {
  removeRequest();
  try {
    FileResponse resp = (FileResponse) result;
    Window.open(GWT.getHostPageBaseURL() + resp.getURL(), "_blank", "width=500,height=500");
    EventBus.getMainEventBus().fireEvent(new ExportFinishedEvent());
  }
  catch (Exception e) {
    ExceptionHandler.handleUnexpectedException(e);
  }
}

代码示例来源:origin: com.progressoft.brix.domino.impl/domino-gwt

@Override
public void publish(LogRecord record) {
  if (isLoggable(record)) {
    if (!ServiceRootMatcher.hasServiceRoot(PATH))
      ((RestServiceProxy) service).setResource(new Resource(GWT.getHostPageBaseURL()));
    else
      ((RestServiceProxy) service).setResource(new Resource(ServiceRootMatcher.matchedServiceRoot(PATH)));
    service.send(asSerializableLogRecord(record), new RemoteLoggingCallBack());
  }
}

相关文章