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

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

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

Web.makePath介绍

[英]Form a path string from the parts of the array starting at index start to the end, each with a '/' in front.
[中]从数组的各个部分(从索引开始到结束)形成一个路径字符串,每个部分前面都有一个“/”。

代码示例

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

@Override
public int doGet(String[] parts, HttpServletRequest req, HttpServletResponse res,
    Session session) throws PortalHandlerException
{
  if ((parts.length >= 2) && (parts[1].equals(HelpHandler.URL_FRAGMENT)) && (parts.length == 2 || !parts[2].equals(HelpHandler.WEB_INF_FRAGMENT)))
  {
    try
    {
      doHelp(req, res, session, req.getContextPath() + req.getServletPath()
          + Web.makePath(parts, 1, 2), Web.makePath(parts, 2, parts.length));
      return END;
    }
    catch (Exception ex)
    {
      throw new PortalHandlerException(ex);
    }
  }
  else
  {
    return NEXT;
  }
}

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

@Override
public int doGet(String[] parts, HttpServletRequest req, HttpServletResponse res,
    Session session) throws PortalHandlerException
{
  if ((parts.length >= 3) && (parts[1].equals(PresenceHandler.URL_FRAGMENT)))
  {
    try
    {
      doPresence(req, res, session, parts[2], req.getContextPath()
          + req.getServletPath() + Web.makePath(parts, 1, 3), Web.makePath(
          parts, 3, parts.length));
      return END;
    }
    catch (Exception ex)
    {
      throw new PortalHandlerException(ex);
    }
  }
  else
  {
    return NEXT;
  }
}

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

@Override
public int doGet(String[] parts, HttpServletRequest req, HttpServletResponse res,
    Session session) throws PortalHandlerException
{
  if ((parts.length >= 2) && (parts[1].equals(HelpHandler.URL_FRAGMENT)) && (parts.length == 2 || !parts[2].equals(HelpHandler.WEB_INF_FRAGMENT)))
  {
    try
    {
      doHelp(req, res, session, req.getContextPath() + req.getServletPath()
          + Web.makePath(parts, 1, 2), Web.makePath(parts, 2, parts.length));
      return END;
    }
    catch (Exception ex)
    {
      throw new PortalHandlerException(ex);
    }
  }
  else
  {
    return NEXT;
  }
}

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

@Override
public int doGet(String[] parts, HttpServletRequest req, HttpServletResponse res,
    Session session) throws PortalHandlerException
{
  if ((parts.length >= 3) && (parts[1].equals(PresenceHandler.URL_FRAGMENT)))
  {
    try
    {
      doPresence(req, res, session, parts[2], req.getContextPath()
          + req.getServletPath() + Web.makePath(parts, 1, 3), Web.makePath(
          parts, 3, parts.length));
      return END;
    }
    catch (Exception ex)
    {
      throw new PortalHandlerException(ex);
    }
  }
  else
  {
    return NEXT;
  }
}

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

ActiveTool helperTool = ActiveToolManager.getActiveTool(helperId);
String context = req.getContextPath() + req.getServletPath() + Web.makePath(parts, 1, 2);
String toolPath = Web.makePath(parts, 2, parts.length);
helperTool.help(req, res, context, toolPath);

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

ActiveTool helperTool = ActiveToolManager.getActiveTool(helperId);
String context = req.getContextPath() + req.getServletPath() + Web.makePath(parts, 1, 2);
String toolPath = Web.makePath(parts, 2, parts.length);
helperTool.help(req, res, context, toolPath);

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

@Override
public int doGet(String[] parts, HttpServletRequest req, HttpServletResponse res,
    Session session) throws PortalHandlerException
{
  if ((parts.length > 2) && (parts[1].equals(PageResetHandler.URL_FRAGMENT)))
  {
    try
    {
      String pagelUrl = req.getContextPath() + "/page"
          + Web.makePath(parts, 2, parts.length);
      // Make sure to add the parameters such as panel=Main
      String queryString = req.getQueryString();
      if (queryString != null)
      {
        pagelUrl = pagelUrl + "?" + queryString;
      }
      portalService.setResetState("true");
      res.sendRedirect(pagelUrl);
      return RESET_DONE;
    }
    catch (Exception ex)
    {
      throw new PortalHandlerException(ex);
    }
  }
  else
  {
    return NEXT;
  }
}

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

@Override
public int doGet(String[] parts, HttpServletRequest req, HttpServletResponse res,
    Session session) throws PortalHandlerException
{
  if ((parts.length > 2) && (parts[1].equals(ToolResetHandler.URL_FRAGMENT)))
  {
    try
    {
      String toolUrl = req.getContextPath() + "/tool"
          + Web.makePath(parts, 2, parts.length);
      // Make sure to add the parameters such as panel=Main
      String queryString = req.getQueryString();
      if (queryString != null)
      {
        toolUrl = toolUrl + "?" + queryString;
      }
      portalService.setResetState("true");
      res.sendRedirect(toolUrl);
      return RESET_DONE;
    }
    catch (Exception ex)
    {
      throw new PortalHandlerException(ex);
    }
  }
  else
  {
    return NEXT;
  }
}

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

@Override
public int doGet(String[] parts, HttpServletRequest req, HttpServletResponse res,
    Session session) throws PortalHandlerException
{
  if ((parts.length > 2) && (parts[1].equals(PageResetHandler.URL_FRAGMENT)))
  {
    try
    {
      String pagelUrl = req.getContextPath() + "/page"
          + Web.makePath(parts, 2, parts.length);
      // Make sure to add the parameters such as panel=Main
      String queryString = req.getQueryString();
      if (queryString != null)
      {
        pagelUrl = pagelUrl + "?" + queryString;
      }
      portalService.setResetState("true");
      res.sendRedirect(pagelUrl);
      return RESET_DONE;
    }
    catch (Exception ex)
    {
      throw new PortalHandlerException(ex);
    }
  }
  else
  {
    return NEXT;
  }
}

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

@Override
public int doGet(String[] parts, HttpServletRequest req, HttpServletResponse res,
    Session session) throws PortalHandlerException
{
  if ((parts.length > 2) && (parts[1].equals(ToolResetHandler.URL_FRAGMENT)))
  {
    try
    {
      String toolUrl = req.getContextPath() + "/tool"
          + Web.makePath(parts, 2, parts.length);
      // Make sure to add the parameters such as panel=Main
      String queryString = req.getQueryString();
      if (queryString != null)
      {
        toolUrl = toolUrl + "?" + queryString;
      }
      portalService.setResetState("true");
      res.sendRedirect(toolUrl);
      return RESET_DONE;
    }
    catch (Exception ex)
    {
      throw new PortalHandlerException(ex);
    }
  }
  else
  {
    return NEXT;
  }
}

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

+ req.getServletPath() + Web.makePath(parts, 1, 3), Web.makePath(
    parts, 3, parts.length));
return END;

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

+ req.getServletPath() + Web.makePath(parts, 1, 3), Web.makePath(
    parts, 3, parts.length));
return END;

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

+ req.getServletPath() + Web.makePath(parts, 1, 3), Web.makePath(
parts, 3, parts.length));

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

+ req.getServletPath() + Web.makePath(parts, 1, 3), Web.makePath(
parts, 3, parts.length));

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

@Override
public int doGet(String[] parts, HttpServletRequest req, HttpServletResponse res,
    Session session) throws PortalHandlerException
{
  if ((parts.length > 2) && (parts[1].equals(WorksiteResetHandler.URL_FRAGMENT)))
  {
    try
    {
      String worksiteUrl = req.getContextPath() + "/worksite"
          + Web.makePath(parts, 2, parts.length);
      // Make sure to add the parameters such as panel=Main
      String queryString = Validator.generateQueryString(req);
      if (queryString != null)
      {
        worksiteUrl = worksiteUrl + "?" + queryString;
      }
      portalService.setResetState("true");
      res.sendRedirect(worksiteUrl);
      return RESET_DONE;
    }
    catch (Exception ex)
    {
      throw new PortalHandlerException(ex);
    }
  }
  else
  {
    return NEXT;
  }
}

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

@Override
public int doGet(String[] parts, HttpServletRequest req, HttpServletResponse res,
    Session session) throws PortalHandlerException
{
  if ((parts.length > 2) && (parts[1].equals(SiteResetHandler.URL_FRAGMENT)))
  {
    try
    {
      String siteUrl = req.getContextPath() + "/site"
          + Web.makePath(parts, 2, parts.length);
      // Make sure to add the parameters such as panel=Main
      String queryString = Validator.generateQueryString(req);
      if (queryString != null)
      {
        siteUrl = siteUrl + "?" + queryString;
      }
      portalService.setResetState("true");
      res.sendRedirect(siteUrl);
      return RESET_DONE;
    }
    catch (Exception ex)
    {
      throw new PortalHandlerException(ex);
    }
  }
  else
  {
    return NEXT;
  }
}

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

@Override
public int doGet(String[] parts, HttpServletRequest req, HttpServletResponse res,
    Session session) throws PortalHandlerException
{
  if ((parts.length > 2) && (parts[1].equals(SiteResetHandler.URL_FRAGMENT)))
  {
    try
    {
      String siteUrl = req.getContextPath() + "/site"
          + Web.makePath(parts, 2, parts.length);
      // Make sure to add the parameters such as panel=Main
      String queryString = Validator.generateQueryString(req);
      if (queryString != null)
      {
        siteUrl = siteUrl + "?" + queryString;
      }
      portalService.setResetState("true");
      res.sendRedirect(siteUrl);
      return RESET_DONE;
    }
    catch (Exception ex)
    {
      throw new PortalHandlerException(ex);
    }
  }
  else
  {
    return NEXT;
  }
}

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

@Override
public int doGet(String[] parts, HttpServletRequest req, HttpServletResponse res,
    Session session) throws PortalHandlerException
{
  if ((parts.length > 2) && (parts[1].equals(WorksiteResetHandler.URL_FRAGMENT)))
  {
    try
    {
      String worksiteUrl = req.getContextPath() + "/worksite"
          + Web.makePath(parts, 2, parts.length);
      // Make sure to add the parameters such as panel=Main
      String queryString = Validator.generateQueryString(req);
      if (queryString != null)
      {
        worksiteUrl = worksiteUrl + "?" + queryString;
      }
      portalService.setResetState("true");
      res.sendRedirect(worksiteUrl);
      return RESET_DONE;
    }
    catch (Exception ex)
    {
      throw new PortalHandlerException(ex);
    }
  }
  else
  {
    return NEXT;
  }
}

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

String toolPathInfo = Web.makePath(parts, 5, parts.length);
Session session = SessionManager.getCurrentSession();

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

String toolPathInfo = Web.makePath(parts, 5, parts.length);
Session session = SessionManager.getCurrentSession();

相关文章