org.sakaiproject.util.Web.serverUrl()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(189)

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

Web.serverUrl介绍

[英]Compute the URL that would return to this server based on the current request. Note: this method is duplicated in the /sakai-kernel-api/src/main/java/org/sakaiproject/util/RequestFilter.java
[中]根据当前请求计算将返回到此服务器的URL。注意:这个方法在/sakai内核api/src/main/java/org/sakai项目/util/RequestFilter中重复。JAVA

代码示例

代码示例来源:origin: sakaiproject/sakai

/**
 * Compute the URL that would return to this servlet based on the current request, with the optional path and parameters
 * 
 * @param req
 *        The request.
 * @return The URL back to this servlet based on the current request.
 */
public static String returnUrl(HttpServletRequest req, String path)
{
  StringBuilder url = new StringBuilder();
  url.append(serverUrl(req));
  url.append(req.getContextPath());
  url.append(req.getServletPath());
  if (path != null) url.append(path);
  // TODO: params
  return url.toString();
}

代码示例来源:origin: sakaiproject/sakai

/**
 * Send the HTML / Javascript to invoke an automatic update
 * 
 * @param out
 * @param req
 *        The request.
 * @param placementId
 *        The tool's placement id / presence location / part of the delivery address
 * @param updateTime
 *        The time (seconds) between courier checks
 * @deprecated 
 *        To avoid inappropriate kernel dependencies, construct this URL in the tool pending relocation of this to courier (see SAK-18481).
 */
public static void sendAutoUpdate(PrintWriter out, HttpServletRequest req, String placementId, int updateTime)
{
  String userId = ComponentManager.get(SessionManager.class).getCurrentSessionUserId();
  StringBuilder url = new StringBuilder(serverUrl(req));
  url.append("/courier/");
  url.append(placementId);
  url.append("?userId=");
  url.append(userId);
  
  out.println("<script type=\"text/javascript\" language=\"JavaScript\">");
  out.println("updateTime = " + updateTime + "000;");
  out.println("updateUrl = \"" + url.toString() + "\";");
  out.println("scheduleUpdate();");
  out.println("</script>");
}

代码示例来源:origin: sakaiproject/sakai

/**
 * Setup the vm context for a courier
 * 
 * @param request
 */
protected void setVmCourier(HttpServletRequest request, int refresh)
{
  // the url for the chat courier
  Placement placement = ToolManager.getCurrentPlacement();
  if (placement != null)
  {
    String userId = SessionManager.getCurrentSessionUserId();
    StringBuilder url = new StringBuilder(Web.serverUrl(request));
    url.append("/courier/");
    url.append(placement.getId());
    url.append("?userId=");
    url.append(userId);
    
    setVmReference("courier", url.toString(), request);
    setVmReference("courierTimeout", Integer.toString(refresh), request);
  }
}

代码示例来源:origin: org.sakaiproject.velocity/sakai-velocity-tool

/**
 * Setup the vm context for a courier
 * 
 * @param request
 */
protected void setVmCourier(HttpServletRequest request, int refresh)
{
  // the url for the chat courier
  Placement placement = ToolManager.getCurrentPlacement();
  if (placement != null)
  {
    String userId = SessionManager.getCurrentSessionUserId();
    StringBuilder url = new StringBuilder(Web.serverUrl(request));
    url.append("/courier/");
    url.append(placement.getId());
    url.append("?userId=");
    url.append(userId);
    
    setVmReference("courier", url.toString(), request);
    setVmReference("courierTimeout", Integer.toString(refresh), request);
  }
}

代码示例来源:origin: org.sakaiproject.portal/sakai-portal-impl

String siteUrl = Web.serverUrl(req)
    + ServerConfigurationService.getString("portalPath") + "/";
if (prefix != null) siteUrl = siteUrl + prefix + "/";

代码示例来源:origin: sakaiproject/sakai

String siteUrl = Web.serverUrl(req)
    + ServerConfigurationService.getString("portalPath") + "/";
if (prefix != null) siteUrl = siteUrl + prefix + "/";

代码示例来源:origin: sakaiproject/sakai

resetActionUrl = Web.serverUrl(req)
+ ServerConfigurationService.getString("portalPath")
+ URLUtils.getSafePathInfo(req) + "?sakai.state.reset=true";
toolMap.put("toolJSR168Help", Web.serverUrl(req) + renderResult.getJSR168HelpUrl());
    .getReference()))
  String editUrl = Web.serverUrl(req) + renderResult.getJSR168EditUrl();
  toolMap.put("toolJSR168Edit", editUrl);
  toolMap.put("toolJSR168EditEncode", URLUtils.encodeUrl(editUrl));

代码示例来源:origin: org.sakaiproject.portal/sakai-portal-impl

resetActionUrl = Web.serverUrl(req)
+ ServerConfigurationService.getString("portalPath")
+ URLUtils.getSafePathInfo(req) + "?sakai.state.reset=true";
toolMap.put("toolJSR168Help", Web.serverUrl(req) + renderResult.getJSR168HelpUrl());
    .getReference()))
  String editUrl = Web.serverUrl(req) + renderResult.getJSR168EditUrl();
  toolMap.put("toolJSR168Edit", editUrl);
  toolMap.put("toolJSR168EditEncode", URLUtils.encodeUrl(editUrl));

代码示例来源:origin: sakaiproject/sakai

if (addLogout)
  String logoutUrl = Web.serverUrl(req)
      + ServerConfigurationService.getString("portalPath")
      + "/logout_gallery";
if (addLogout)
  String logoutUrl = Web.serverUrl(req)
      + ServerConfigurationService.getString("portalPath")
      + "/logout_gallery";

代码示例来源:origin: org.sakaiproject.portal/sakai-portal-impl

if (addLogout)
  String logoutUrl = Web.serverUrl(req)
      + ServerConfigurationService.getString("portalPath")
      + "/logout_gallery";
if (addLogout)
  String logoutUrl = Web.serverUrl(req)
      + ServerConfigurationService.getString("portalPath")
      + "/logout_gallery";

代码示例来源:origin: sakaiproject/sakai

rcontext.put("currentUrlPath", Web.serverUrl(req) + req.getContextPath()
    + URLUtils.getSafePathInfo(req));

代码示例来源:origin: org.sakaiproject.portal/sakai-portal-impl

rcontext.put("currentUrlPath", Web.serverUrl(req) + req.getContextPath()
    + URLUtils.getSafePathInfo(req));

代码示例来源:origin: sakaiproject/sakai

String logInOutUrl = Web.serverUrl(req);
String message = null;
String image1 = null;

代码示例来源:origin: org.sakaiproject.portal/sakai-portal-impl

String logInOutUrl = Web.serverUrl(req);
String message = null;
String image1 = null;

代码示例来源:origin: sakaiproject/sakai

String portalTopUrl = Web.serverUrl(req)
+ ServerConfigurationService.getString("portalPath") + "/";
if (prefix != null) portalTopUrl = portalTopUrl + prefix + "/";

代码示例来源:origin: org.sakaiproject.portal/sakai-portal-impl

String portalTopUrl = Web.serverUrl(req)
+ ServerConfigurationService.getString("portalPath") + "/";
if (prefix != null) portalTopUrl = portalTopUrl + prefix + "/";

相关文章