Gets the Struts module path from the input request.  If a ModuleConfig
object has been populated into the request it is used to get the module prefix,
otherwise getModulePath is called, which derives the module path from
the request URI.
320720
public static String getModulePathFromReqAttr( HttpServletRequest request )
    {
        //
        // If a config was in the request, use its associated prefix; otherwise, fall back to the URI.
        //
        ModuleConfig config = ( ModuleConfig ) request.getAttribute( Globals.MODULE_KEY );
        return config != null ? config.getPrefix() : PageFlowUtils.getModulePath( request );
    }
818729
public Module lookupModule(String mod) {
        Module m = modules.get(mod);
        if (m == null) {
            m = new Module(mod, "???");
            modules.put(mod, m);
        }
        return m;
    }
1285025
@Override
    public String getServletPath() {
        try {
            collaborator.preInvoke(componentMetaData);
            return request.getServletPath();
        } finally {
            collaborator.postInvoke();
        }
    }
1069842
protected String getRequestPath(String requestFullPath, String servletContextPath, String servletPath) {
		return requestFullPath.substring(escapedLength(servletContextPath) + escapedLength(servletPath));
	}
853176
function findModulePath(request, parent) {
  var mainScriptDir = path.dirname(Module._resolveFilename(request, parent));
  var resolvedModule = Module._resolveLookupPaths(request, parent);
  var paths = resolvedModule[1];
  for (var i = 0, PL = paths.length; i < PL; i++) {
    if (mainScriptDir.indexOf(paths[i]) === 0) {
      return path.join(paths[i], request.replace('/', path.sep));
    }
  }
  return null;
}
67680
@Nonnull
  public static String getRequestServletPath (@Nullable final HttpServletRequest aRequest)
  {
    String ret = "";
    if (aRequest != null)
      try
      {
        if (aRequest.isAsyncSupported () && aRequest.isAsyncStarted ())
          ret = (String) aRequest.getAttribute (AsyncContext.ASYNC_SERVLET_PATH);
        else
          ret = aRequest.getServletPath ();
      }
      catch (final UnsupportedOperationException ex)
      {
        // Offline request - fall through
      }
      catch (final Exception ex)
      {
        // fall through
        if (isLogExceptions ())
          if (LOGGER.isWarnEnabled ())
            LOGGER.warn ("[ServletHelper] Failed to determine servlet path of HTTP request", ex);
      }
    return ret;
  }
1270952
@Override
	public List<String> getModules() throws BadRequestException {
		final String sourceMethod = "getModules"; //$NON-NLS-1$
		if (isTraceLogging) {
			log.entering(RequestedModuleNames.class.getName(), sourceMethod);
		}
		if (modules == null) {
			modules = decodeModules(moduleQueryArg, base64decodedIdList, true);
			if (modules.size() != count) {
				throw new BadRequestException();
			}
		}
		if (isTraceLogging) {
			log.exiting(RequestedModuleNames.class.getName(), sourceMethod, modules);
		}
		return modules;
	}
1316558
public String getServletPath(HttpServerRequest<I> request, HttpKeyEvaluationContext context) {
        String requestUriPath = context.getRequestUriPath(request);
        if (null != requestUriPath) {
            return matcher.getServletPath(requestUriPath);
        }
        return "";
    }
61992
def get_module_data_path(modname, relpath=None, attr_name='DATAPATH'):
    """"""
    datapath = getattr(sys.modules[modname], attr_name, '')
    if datapath:
        return datapath
    else:
        datapath = get_module_path(modname)
        parentdir = osp.join(datapath, osp.pardir)
        if osp.isfile(parentdir):
            # Parent directory is not a directory but the 'library.zip' file:
            # this is either a py2exe or a cx_Freeze distribution
            datapath = osp.abspath(osp.join(osp.join(parentdir, osp.pardir),
                                            modname))
        if relpath is not None:
            datapath = osp.abspath(osp.join(datapath, relpath))
        return datapath
196320
private String buildServletPath() {
    String uri = servletPath;
    if (uri == null && null != requestURI) {
      uri = requestURI;
      if (!contextPath.equals("/")) uri = uri.substring(contextPath.length());
    }
    return (null == uri) ? "" : uri;
  }
157945
def find_module_path():
    """"""
    master_modname = __name__.split(".", 1)[0]
    master_module = sys.modules[master_modname]
    #return os.path.dirname(os.path.realpath(os.path.join(inspect.getsourcefile(endpoints), "..")))
    path = os.path.dirname(inspect.getsourcefile(master_module))
    return path
784181
protected Path getModuleJarPath(ModuleId moduleId) {
        Path moduleJarPath = rootDir.resolve(moduleId + ".jar");
        return moduleJarPath;
    }
437021
public static String getServletContextPath(ExternalContext ec)
    {
        if (!isPortlet(ec))
        {
            return ((ServletContext) ec.getContext()).getContextPath();
        }
        else
        {
            return null;
        }
    }
1172335
@Nullable
  JSModule getModuleByName(String name) {
    for (JSModule m : modules) {
      if (m.getName().equals(name)) {
        return m;
      }
    }
    return null;
  }
1049062
public static String getModuleName(URL jrtUrl) {
    if (!"jrt".equalsIgnoreCase(jrtUrl.getProtocol())) {
      return null;
    }
    try {
      // use URI class to also decode path and remove escapes:
      String mod = jrtUrl.toURI().getPath();
      if (mod != null && mod.length() >= 1) {
        mod = mod.substring(1);
        int p = mod.indexOf('/');
        if (p >= 0) {
          mod = mod.substring(0, p);
        }
        return mod.isEmpty() ? null : mod;
      }
      return null;
    } catch (URISyntaxException use) {
      return null;
    }
  }
682413
function Request__handleModule(path) {
        var moduleToLoad = path + this.module,
            LoadedModule,
            module;

        try {
            LoadedModule = di.load(moduleToLoad);
        } catch (e) {
            throw new error.HttpError(500, {path: moduleToLoad}, 'Missing module', e);
        }

        if (!Type.assert(Type.FUNCTION, LoadedModule)) {
            throw new error.HttpError(500, {path: moduleToLoad}, 'Module must be function type');
        }

        module = new LoadedModule(this.module);

        if (!(module instanceof  ModuleInterface)) {
            throw new error.HttpError(500, {module: module}, 'Module must be instance of ModuleInterface "core/module"');
        }


        return this._handleController(module.getControllersPath(), module.getViewsPath());
    }
763140
private String getRequestPath(HttpServletRequest request) {

		String finalUrl = null;
		String servletPath = request.getServletPath();
		if ("".equals(jawrConfig.getServletMapping())) {
			finalUrl = PathNormalizer.asPath(servletPath);
		} else {
			finalUrl = PathNormalizer.asPath(servletPath + request.getPathInfo());
		}
		return finalUrl;
	}