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

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

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

Web.returnUrl介绍

[英]Compute the URL that would return to this servlet based on the current request, with the optional path and parameters
[中]使用可选路径和参数,根据当前请求计算将返回到此servlet的URL

代码示例

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

public String getActionURL(FacesContext context, String viewId)
{
  HttpServletRequest req = (HttpServletRequest) context.getExternalContext().getRequest();
  if (req.getAttribute(URL_EXT) == null)
  {
    // If the request didn't go through JsfTool (the JSF is accessed directly from its webapp, 
    // not as a Sakai tool), then don't do Sakai's special action URL handling.
    return m_wrapped.getActionURL(context, viewId);
  }
  
  // get the path that got us here (from the tool's point of view)
  String path = viewId;
  // modify the path to remove things that were added by Sakai navigation to get here (prefix path, suffix extension)
  String prefix = (String) req.getAttribute(URL_PATH);
  if ((prefix != null) && path.startsWith(prefix)) path = path.substring(prefix.length());
  Object extensions = req.getAttribute(URL_EXT);
  String [] exts = extensions instanceof String?new String[]{(String)extensions}:(String[])extensions; 
  for (String ext:exts) {
    if ((ext != null) && path.endsWith(ext)) path = path.substring(0, path.length() - ext.length());
  }
  // make sure the URL processing uses the Sakai, not Native the request object so we can get at the URL information setup by the invoker
  req.removeAttribute(Tool.NATIVE_URL);
  // form our return URL
  String rv = Web.returnUrl(req, path);
  // restore (if needed)
  req.setAttribute(Tool.NATIVE_URL, Tool.NATIVE_URL);
  log.debug("action url for view: " + viewId + " = " + rv);
  return rv;
}

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

public String getActionURL(FacesContext context, String viewId)
{
  HttpServletRequest req = (HttpServletRequest) context.getExternalContext().getRequest();
  if (req.getAttribute(URL_EXT) == null)
  {
    // If the request didn't go through JsfTool (the JSF is accessed directly from its webapp, 
    // not as a Sakai tool), then don't do Sakai's special action URL handling.
    return m_wrapped.getActionURL(context, viewId);
  }
  
  // get the path that got us here (from the tool's point of view)
  String path = viewId;
  // modify the path to remove things that were added by Sakai navigation to get here (prefix path, suffix extension)
  String prefix = (String) req.getAttribute(URL_PATH);
  if ((prefix != null) && path.startsWith(prefix)) path = path.substring(prefix.length());
  Object extensions = req.getAttribute(URL_EXT);
  String [] exts = extensions instanceof String?new String[]{(String)extensions}:(String[])extensions; 
  for (String ext:exts) {
    if ((ext != null) && path.endsWith(ext)) path = path.substring(0, path.length() - ext.length());
  }
  // make sure the URL processing uses the Sakai, not Native the request object so we can get at the URL information setup by the invoker
  req.removeAttribute(Tool.NATIVE_URL);
  // form our return URL
  String rv = Web.returnUrl(req, path);
  // restore (if needed)
  req.setAttribute(Tool.NATIVE_URL, Tool.NATIVE_URL);
  log.debug("action url for view: " + viewId + " = " + rv);
  return rv;
}

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

String rv = Web.returnUrl(req, path);

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

/**
   * Get a new ActionURL.
   * 
   * @param req
   *        The current request.
   * @return A new ActionURL.
   */
  protected ActionURL getActionURL(HttpServletRequest request)
  {
    ActionURL a = new ActionURL(Web.returnUrl(request, null), request);

    // set the pid and panel, if present in the request
    // a.setPid(request.getParameter(ActionURL.PARAM_PID));
    a.setPanel(request.getParameter(ActionURL.PARAM_PANEL));
    a.setSite(request.getParameter(ActionURL.PARAM_SITE));
    a.setPage(request.getParameter(ActionURL.PARAM_PAGE));

    return a;
  }
}

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

/**
   * Get a new ActionURL.
   * 
   * @param req
   *        The current request.
   * @return A new ActionURL.
   */
  protected ActionURL getActionURL(HttpServletRequest request)
  {
    ActionURL a = new ActionURL(Web.returnUrl(request, null), request);

    // set the pid and panel, if present in the request
    // a.setPid(request.getParameter(ActionURL.PARAM_PID));
    a.setPanel(request.getParameter(ActionURL.PARAM_PANEL));
    a.setSite(request.getParameter(ActionURL.PARAM_SITE));
    a.setPage(request.getParameter(ActionURL.PARAM_PAGE));

    return a;
  }
}

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

String returnUrl = Web.returnUrl(req, returnPath);
if (req.getQueryString() != null )
  returnUrl += "?"+req.getQueryString();

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

" context=" + context + " web util val=" + Web.returnUrl(req, value));

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

res.sendRedirect(Web.returnUrl(req, target));
return;
res.sendRedirect(Web.returnUrl(req, newTarget));
return;

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

String returnUrl = Web.returnUrl(req, returnPath);
if (req.getQueryString() != null )
  returnUrl += "?"+req.getQueryString();

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

res.sendRedirect(Web.returnUrl(req, target));
return;
res.sendRedirect(Web.returnUrl(req, newTarget));
return;

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

res.sendRedirect(Web.returnUrl(req, target));
return;
res.sendRedirect(Web.returnUrl(req, newTarget));
return;

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

res.sendRedirect(Web.returnUrl(req, target));
return;
res.sendRedirect(Web.returnUrl(req, newTarget));
return;

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

res.sendRedirect(Web.returnUrl(req, target));
return;
res.sendRedirect(Web.returnUrl(req, newTarget));
return;

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

res.sendRedirect(Web.returnUrl(req, target));
return;
res.sendRedirect(Web.returnUrl(req, newTarget));
return;

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

session.setAttribute(Tool.HELPER_DONE_URL, Web.returnUrl(req, Validator.escapeUrl(path)));

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

String addr = Web.returnUrl(req, req.getPathInfo())
+ ("/".equals(req.getPathInfo()) ? "" : Entity.SEPARATOR);
try

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

Site s = (Site) iSi.next();
if (myWorkspaceSiteId.equals(s.getId()) ) {
  mrphs_worksiteUrl = Web.returnUrl(request, "/site/" + Web.escapeUrl(siteHelper.getSiteEffectiveId(s)));
  List pages = siteHelper.getPermittedPagesInOrder(s);
  for (Iterator iPg = pages.iterator(); iPg.hasNext();) {
      ToolConfiguration placement = (ToolConfiguration) iPt.next();
      if ( profileToolId.equals(placement.getToolId()) ) {
        profileToolUrl = Web.returnUrl(request, "/site/" + Web.escapeUrl(siteHelper.getSiteEffectiveId(s)) + "/page/" + Web.escapeUrl(p.getId()));
        mrphs_profileToolUrl = Web.returnUrl(request, "/site/" + Web.escapeUrl(siteHelper.getSiteEffectiveId(s)) + "/tool-reset/" + Web.escapeUrl(placement.getId()));
      } else if ( preferencesToolId.equals(placement.getToolId()) ) {
        prefsToolUrl = Web.returnUrl(request, "/site/" + Web.escapeUrl(siteHelper.getSiteEffectiveId(s)) + "/page/" + Web.escapeUrl(p.getId()));
        mrphs_prefsToolUrl = Web.returnUrl(request, "/site/" + Web.escapeUrl(siteHelper.getSiteEffectiveId(s)) + "/tool-reset/" + Web.escapeUrl(placement.getId()));
      } else if ( worksiteToolId.equals(placement.getToolId()) ) {
        worksiteToolUrl = Web.returnUrl(request, "/site/" + Web.escapeUrl(siteHelper.getSiteEffectiveId(s)) + "/page/" + Web.escapeUrl(p.getId()));
        mrphs_worksiteToolUrl = Web.returnUrl(request, "/site/" + Web.escapeUrl(siteHelper.getSiteEffectiveId(s)) + "/tool-reset/" + Web.escapeUrl(placement.getId()));

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

String url = Web.returnUrl(req, null);

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

String pageUrl = Web.returnUrl(req, "/" + portalPrefix + "/"
    + Web.escapeUrl(effectiveSiteId) + "/page/");
pageUrl = pageUrl + Web.escapeUrl(pageAlias);
if (!trinity) return pageUrl;
pageUrl = Web.returnUrl(req, "/" + portalPrefix + "/" + Web.escapeUrl(effectiveSiteId));
if (reset || resetSiteProperty) {
  pageUrl = pageUrl + "/tool-reset/";

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

String addr = Web.returnUrl(req, req.getPathInfo()) + "index.html";
try

相关文章