code: protected String computeContextPath(
              final IExpressionContext context, final String base, final Map<String, Object> parameters) {
  
          if (!(context instanceof IWebContext)) {
              throw new TemplateProcessingException(
                      "Link base \"" + base + "\" cannot be context relative (/...) unless the context " +
                      "used for executing the engine implements the " + IWebContext.class.getName() + " interface");
          }
  
          // If it is context-relative, it has to be a web context
          final HttpServletRequest request = ((IWebContext)context).getRequest();
          return request.getContextPath();
  
      }
docs: <p>
  Compute the context path to be applied to URLs that have been determined to be context-relative (and therefore
  need a context path to be inserted at their beginning).
  </p>
  <p>
  By default, this method will obtain the context path from {@code HttpServletRequest.getContextPath()},
  throwing an exception if {@code context} is not an instance of {@code IWebContext} given context-relative
  URLs are (by default) only allowed in web contexts.
  </p>
  <p>
  This method can be overridden by any subclasses that want to change this behaviour (e.g. in order to
  avoid using the Servlet API for resolving context path or to allow context-relative URLs in non-web
  contexts).
  </p>
  
  @param context the execution context.
  @param base the URL base specified.
  @param parameters the URL parameters specified.
  @return the context path.