當前位置: 首頁>>代碼示例>>Java>>正文


Java Context.getPath方法代碼示例

本文整理匯總了Java中org.apache.catalina.Context.getPath方法的典型用法代碼示例。如果您正苦於以下問題:Java Context.getPath方法的具體用法?Java Context.getPath怎麽用?Java Context.getPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.catalina.Context的用法示例。


在下文中一共展示了Context.getPath方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: unregisterWrapper

import org.apache.catalina.Context; //導入方法依賴的package包/類
/**
 * Unregister wrapper.
 */
private void unregisterWrapper(Wrapper wrapper) {

    Context context = (Context) wrapper.getParent();
    String contextPath = context.getPath();
    String wrapperName = wrapper.getName();

    if ("/".equals(contextPath)) {
        contextPath = "";
    }
    String version = context.getWebappVersion();
    String hostName = context.getParent().getName();

    String[] mappings = wrapper.findMappings();

    for (String mapping : mappings) {
        mapper.removeWrapper(hostName, contextPath, version,  mapping);
    }

    if(log.isDebugEnabled()) {
        log.debug(sm.getString("mapperListener.unregisterWrapper",
                wrapperName, contextPath, connector));
    }
}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:27,代碼來源:MapperListener.java

示例2: registerWrapper

import org.apache.catalina.Context; //導入方法依賴的package包/類
/**
 * Register wrapper.
 */
private void registerWrapper(Wrapper wrapper) {

    Context context = (Context) wrapper.getParent();
    String contextPath = context.getPath();
    if ("/".equals(contextPath)) {
        contextPath = "";
    }
    String version = context.getWebappVersion();
    String hostName = context.getParent().getName();

    List<WrapperMappingInfo> wrappers = new ArrayList<WrapperMappingInfo>();
    prepareWrapperMappingInfo(context, wrapper, wrappers);
    mapper.addWrappers(hostName, contextPath, version, wrappers);

    if(log.isDebugEnabled()) {
        log.debug(sm.getString("mapperListener.registerWrapper",
                wrapper.getName(), contextPath, connector));
    }
}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:23,代碼來源:MapperListener.java

示例3: customize

import org.apache.catalina.Context; //導入方法依賴的package包/類
/**
 * Customize the specified context to have its own log file instead of
 * inheriting the default one.  This is just an example of what you can
 * do; pretty much anything (such as installing special Valves) can
 * be done prior to calling <code>start()</code>.
 *
 * @param context Context to receive a specialized logger
 */
private static void customize(Context context) {

    // Create a customized file logger for this context
    String basename = context.getPath();
    if (basename.length() < 1)
        basename = "ROOT";
    else
        basename = basename.substring(1);

    FileLogger special = new FileLogger();
    special.setPrefix(basename + "_log.");
    special.setSuffix(".txt");
    special.setTimestamp(true);

    // Override the default logger for this context
    context.setLogger(special);

}
 
開發者ID:c-rainstorm,項目名稱:jerrydog,代碼行數:27,代碼來源:Embedded.java

示例4: addChild

import org.apache.catalina.Context; //導入方法依賴的package包/類
/**
 * Delegate a request to add a child Context to our associated Host.
 *
 * @param child The child Context to be added
 */
public void addChild(Container child) {

    context = (Context) child;
    String contextPath = context.getPath();
    if (contextPath == null)
        throw new IllegalArgumentException
            (sm.getString("standardHost.pathRequired"));
    else if (!contextPath.equals("") && !contextPath.startsWith("/"))
        throw new IllegalArgumentException
            (sm.getString("standardHost.pathFormat", contextPath));
    if (host.findChild(contextPath) != null)
        throw new IllegalStateException
            (sm.getString("standardHost.pathUsed", contextPath));
    if (this.overrideDocBase != null)
        context.setDocBase(this.overrideDocBase);
    host.fireContainerEvent(PRE_INSTALL_EVENT, context);
    host.addChild(child);
    host.fireContainerEvent(INSTALL_EVENT, context);

}
 
開發者ID:c-rainstorm,項目名稱:jerrydog,代碼行數:26,代碼來源:StandardHostDeployer.java

示例5: list

import org.apache.catalina.Context; //導入方法依賴的package包/類
/**
 * Render a list of the currently active Contexts in our virtual host.
 *
 * @param writer
 *            Writer to render to
 */
protected void list(PrintWriter writer, StringManager smClient) {

	if (debug >= 1)
		log("list: Listing contexts for virtual host '" + host.getName() + "'");

	writer.println(smClient.getString("managerServlet.listed", host.getName()));
	Container[] contexts = host.findChildren();
	for (int i = 0; i < contexts.length; i++) {
		Context context = (Context) contexts[i];
		if (context != null) {
			String displayPath = context.getPath();
			if (displayPath.equals(""))
				displayPath = "/";
			if (context.getState().isAvailable()) {
				writer.println(smClient.getString("managerServlet.listitem", displayPath, "running",
						"" + context.getManager().findSessions().length, context.getDocBase()));
			} else {
				writer.println(smClient.getString("managerServlet.listitem", displayPath, "stopped", "0",
						context.getDocBase()));
			}
		}
	}
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:30,代碼來源:ManagerServlet.java

示例6: unregisterWrapper

import org.apache.catalina.Context; //導入方法依賴的package包/類
/**
 * Unregister wrapper.
 */
private void unregisterWrapper(Wrapper wrapper) {

	Context context = (Context) wrapper.getParent();
	String contextPath = context.getPath();
	String wrapperName = wrapper.getName();

	if ("/".equals(contextPath)) {
		contextPath = "";
	}
	String version = context.getWebappVersion();
	String hostName = context.getParent().getName();

	String[] mappings = wrapper.findMappings();

	for (String mapping : mappings) {
		mapper.removeWrapper(hostName, contextPath, version, mapping);
	}

	if (log.isDebugEnabled()) {
		log.debug(sm.getString("mapperListener.unregisterWrapper", wrapperName, contextPath, connector));
	}
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:26,代碼來源:MapperListener.java

示例7: registerWrapper

import org.apache.catalina.Context; //導入方法依賴的package包/類
/**
 * Register wrapper.
 */
private void registerWrapper(Wrapper wrapper) {

	Context context = (Context) wrapper.getParent();
	String contextPath = context.getPath();
	if ("/".equals(contextPath)) {
		contextPath = "";
	}
	String version = context.getWebappVersion();
	String hostName = context.getParent().getName();

	List<WrapperMappingInfo> wrappers = new ArrayList<WrapperMappingInfo>();
	prepareWrapperMappingInfo(context, wrapper, wrappers);
	mapper.addWrappers(hostName, contextPath, version, wrappers);

	if (log.isDebugEnabled()) {
		log.debug(sm.getString("mapperListener.registerWrapper", wrapper.getName(), contextPath, connector));
	}
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:22,代碼來源:MapperListener.java

示例8: list

import org.apache.catalina.Context; //導入方法依賴的package包/類
/**
 * Render a list of the currently active Contexts in our virtual host.
 *
 * @param writer Writer to render to
 */
protected void list(PrintWriter writer, StringManager smClient) {

    if (debug >= 1)
        log("list: Listing contexts for virtual host '" +
            host.getName() + "'");

    writer.println(smClient.getString("managerServlet.listed",
                                host.getName()));
    Container[] contexts = host.findChildren();
    for (int i = 0; i < contexts.length; i++) {
        Context context = (Context) contexts[i];
        if (context != null ) {
            String displayPath = context.getPath();
            if( displayPath.equals("") )
                displayPath = "/";
            if (context.getState().isAvailable()) {
                writer.println(smClient.getString("managerServlet.listitem",
                        displayPath,
                        "running",
                        "" + context.getManager().findSessions().length,
                        context.getDocBase()));
            } else {
                writer.println(smClient.getString("managerServlet.listitem",
                        displayPath,
                        "stopped",
                        "0",
                        context.getDocBase()));
            }
        }
    }
}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:37,代碼來源:ManagerServlet.java

示例9: registerContext

import org.apache.catalina.Context; //導入方法依賴的package包/類
/**
 * Register context.
 */
private void registerContext(Context context) {

    String contextPath = context.getPath();
    if ("/".equals(contextPath)) {
        contextPath = "";
    }
    Container host = context.getParent();

    javax.naming.Context resources = context.getResources();
    String[] welcomeFiles = context.findWelcomeFiles();
    List<WrapperMappingInfo> wrappers = new ArrayList<WrapperMappingInfo>();

    for (Container container : context.findChildren()) {
        prepareWrapperMappingInfo(context, (Wrapper) container, wrappers);

        if(log.isDebugEnabled()) {
            log.debug(sm.getString("mapperListener.registerWrapper",
                    container.getName(), contextPath, connector));
        }
    }

    mapper.addContextVersion(host.getName(), host, contextPath,
            context.getWebappVersion(), context, welcomeFiles, resources,
            wrappers, context.getMapperContextRootRedirectEnabled(),
            context.getMapperDirectoryRedirectEnabled());

    if(log.isDebugEnabled()) {
        log.debug(sm.getString("mapperListener.registerContext",
                contextPath, connector));
    }
}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:35,代碼來源:MapperListener.java

示例10: unregisterContext

import org.apache.catalina.Context; //導入方法依賴的package包/類
/**
 * Unregister context.
 */
private void unregisterContext(Context context) {

    String contextPath = context.getPath();
    if ("/".equals(contextPath)) {
        contextPath = "";
    }
    String hostName = context.getParent().getName();

    if(log.isDebugEnabled()) {
        log.debug(sm.getString("mapperListener.unregisterContext",
                contextPath, connector));
    }

    if (context.getPaused()) {
        if (log.isDebugEnabled()) {
            log.debug(sm.getString("mapperListener.pauseContext",
                    contextPath, connector));
        }

        mapper.pauseContextVersion(context, hostName, contextPath,
                context.getWebappVersion());
    } else {
        if (log.isDebugEnabled()) {
            log.debug(sm.getString("mapperListener.unregisterContext",
                    contextPath, connector));
        }

        mapper.removeContextVersion(hostName, contextPath,
                context.getWebappVersion());
    }
}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:35,代碼來源:MapperListener.java

示例11: list

import org.apache.catalina.Context; //導入方法依賴的package包/類
/**
 * Render a list of the currently active Contexts in our virtual host.
 *
 * @param writer Writer to render to
 */
protected void list(PrintWriter writer) {

    if (debug >= 1)
        log("list: Listing contexts for virtual host '" +
            host.getName() + "'");

    writer.println(sm.getString("managerServlet.listed",
                                host.getName()));
    Container[] contexts = host.findChildren();
    for (int i = 0; i < contexts.length; i++) {
        Context context = (Context) contexts[i];
        String displayPath = context.getPath();
        if( displayPath.equals("") )
            displayPath = "/";
        if (context != null ) {
            if (context.getAvailable()) {
                writer.println(sm.getString("managerServlet.listitem",
                                            displayPath,
                                            "running",
                                  "" + context.getManager().findSessions().length,
                                            context.getDocBase()));
            } else {
                writer.println(sm.getString("managerServlet.listitem",
                                            displayPath,
                                            "stopped",
                                            "0",
                                            context.getDocBase()));
            }
        }
    }
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:37,代碼來源:ManagerServlet.java

示例12: registerContext

import org.apache.catalina.Context; //導入方法依賴的package包/類
/**
 * Register context.
 */
private void registerContext(Context context) {

    String contextPath = context.getPath();
    if ("/".equals(contextPath)) {
        contextPath = "";
    }
    Container host = context.getParent();

    javax.naming.Context resources = context.getResources();
    String[] welcomeFiles = context.findWelcomeFiles();
    List<WrapperMappingInfo> wrappers = new ArrayList<WrapperMappingInfo>();

    for (Container container : context.findChildren()) {
        prepareWrapperMappingInfo(context, (Wrapper) container, wrappers);

        if(log.isDebugEnabled()) {
            log.debug(sm.getString("mapperListener.registerWrapper",
                    container.getName(), contextPath, connector));
        }
    }

    mapper.addContextVersion(host.getName(), host, contextPath,
            context.getWebappVersion(), context, welcomeFiles, resources,
            wrappers, context.getMapperContextRootRedirectEnabled(),//default false
            context.getMapperDirectoryRedirectEnabled());//default false

    if(log.isDebugEnabled()) {
        log.debug(sm.getString("mapperListener.registerContext",
                contextPath, connector));
    }
}
 
開發者ID:sunmingshuai,項目名稱:apache-tomcat-7.0.73-with-comment,代碼行數:35,代碼來源:MapperListener.java

示例13: registerContext

import org.apache.catalina.Context; //導入方法依賴的package包/類
/**
 * Register context.
 */
private void registerContext(Context context) {

	String contextPath = context.getPath();
	if ("/".equals(contextPath)) {
		contextPath = "";
	}
	Container host = context.getParent();

	javax.naming.Context resources = context.getResources();
	String[] welcomeFiles = context.findWelcomeFiles();
	List<WrapperMappingInfo> wrappers = new ArrayList<WrapperMappingInfo>();

	for (Container container : context.findChildren()) {
		prepareWrapperMappingInfo(context, (Wrapper) container, wrappers);

		if (log.isDebugEnabled()) {
			log.debug(sm.getString("mapperListener.registerWrapper", container.getName(), contextPath, connector));
		}
	}

	mapper.addContextVersion(host.getName(), host, contextPath, context.getWebappVersion(), context, welcomeFiles,
			resources, wrappers, context.getMapperContextRootRedirectEnabled(),
			context.getMapperDirectoryRedirectEnabled());

	if (log.isDebugEnabled()) {
		log.debug(sm.getString("mapperListener.registerContext", contextPath, connector));
	}
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:32,代碼來源:MapperListener.java

示例14: unregisterContext

import org.apache.catalina.Context; //導入方法依賴的package包/類
/**
 * Unregister context.
 */
private void unregisterContext(Context context) {

	String contextPath = context.getPath();
	if ("/".equals(contextPath)) {
		contextPath = "";
	}
	String hostName = context.getParent().getName();

	if (log.isDebugEnabled()) {
		log.debug(sm.getString("mapperListener.unregisterContext", contextPath, connector));
	}

	if (context.getPaused()) {
		if (log.isDebugEnabled()) {
			log.debug(sm.getString("mapperListener.pauseContext", contextPath, connector));
		}

		mapper.pauseContextVersion(context, hostName, contextPath, context.getWebappVersion());
	} else {
		if (log.isDebugEnabled()) {
			log.debug(sm.getString("mapperListener.unregisterContext", contextPath, connector));
		}

		mapper.removeContextVersion(hostName, contextPath, context.getWebappVersion());
	}
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:30,代碼來源:MapperListener.java


注:本文中的org.apache.catalina.Context.getPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。