本文整理汇总了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));
}
}
示例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));
}
}
示例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);
}
示例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);
}
示例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()));
}
}
}
}
示例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));
}
}
示例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));
}
}
示例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()));
}
}
}
}
示例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));
}
}
示例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());
}
}
示例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()));
}
}
}
}
示例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));
}
}
示例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));
}
}
示例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());
}
}