本文整理了Java中org.apache.catalina.Context.getPath()
方法的一些代码示例,展示了Context.getPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.getPath()
方法的具体详情如下:
包路径:org.apache.catalina.Context
类名称:Context
方法名:getPath
[英]Return the context path for this web application.
[中]返回此web应用程序的上下文路径。
代码示例来源:origin: stackoverflow.com
ContextInfo makeContextInfo(Context context) {
// copy to another object -- not the important part
final ContextInfo info = new ContextInfo(context.getPath());
info.setThisPart(context.getThisPart());
info.setNotImportant(context.getNotImportant());
return info;
}
代码示例来源:origin: apache/geode
+ " as s where s.contextName = '" + context.getPath() + "'");
getLogger().debug("Query: " + query.getQueryString());
getLogger().debug("No sessions to unload for context " + context.getPath());
return; // nothing to do
File store = sessionStore(context.getPath());
if (store == null) {
return;
代码示例来源:origin: apache/geode
File store = sessionStore(context.getPath());
if (store == null) {
getLogger().debug("No session store file found");
代码示例来源:origin: magro/memcached-session-manager
@BeforeMethod
public void setUp() throws Exception {
_service = mock( MemcachedSessionService.class );
_request = mock( Request.class );
_response = mock( Response.class );
final Context _contextContainer = mock(Context.class);
final Host _hostContainer = mock(Host.class);
final SessionManager _manager = mock(SessionManager.class);
when(_service.getManager()).thenReturn(_manager);
when(_manager.getContext()).thenReturn(_contextContainer);
when(_contextContainer.getParent()).thenReturn(_hostContainer);
when(_contextContainer.getPath()).thenReturn("/");
_sessionTrackerValve = createSessionTrackerValve();
_nextValve = mock( Valve.class );
_sessionTrackerValve.setNext( _nextValve );
_sessionTrackerValve.setContainer(_hostContainer);
when(_request.getRequestURI()).thenReturn( "/someRequest");
when(_request.getMethod()).thenReturn("GET");
when(_request.getQueryString()).thenReturn(null);
when(_request.getContext()).thenReturn(_contextContainer);
when(_request.getNote(eq(RequestTrackingHostValve.REQUEST_PROCESSED))).thenReturn(Boolean.TRUE);
when(_request.getNote(eq(RequestTrackingHostValve.SESSION_ID_CHANGED))).thenReturn(Boolean.FALSE);
}
代码示例来源:origin: org.jboss.mod_cluster/mod_cluster
/**
* {@inhericDoc}
* @see org.jboss.modcluster.Context#getPath()
*/
public String getPath()
{
return this.context.getPath();
}
代码示例来源:origin: org.jboss.mod_cluster/mod_cluster
/**
* {@inhericDoc}
* @see java.lang.Object#toString()
*/
@Override
public String toString()
{
return this.context.getPath();
}
代码示例来源:origin: com.springsource.insight/insight-collection-tcserver
public static String label(Context context) {
String displayName = context.getDisplayName();
String contextPath = context.getPath();
if ("".equals(contextPath)) {
contextPath = "/";
}
if (displayName == null) {
return contextPath;
}
return contextPath + " (" + displayName + ")";
}
代码示例来源:origin: org.apache.tomee/tomee-catalina
@Override
public SecurityConstraint[] findSecurityConstraints(final Request request, final Context context) {
final Map<String, ServletSecurityElement> map = (Map<String, ServletSecurityElement>) invoke(findSecurityConstraintsMethod, request.getRequest(), context.getPath());
final List<SecurityConstraint> constraints = new ArrayList<SecurityConstraint>();
for (final Map.Entry<String, ServletSecurityElement> entry : map.entrySet()) {
constraints.addAll(Arrays.asList(SecurityConstraint.createConstraints(entry.getValue(), entry.getKey())));
}
return constraints.toArray(new SecurityConstraint[constraints.size()]);
}
代码示例来源:origin: org.springframework.osgi/org.springframework.osgi.web
TomcatWarDeployment(TomcatContextUndeployer undeployer, Bundle bundle, Context catalinaContext) {
this.undeployer = undeployer;
this.catalinaContext = catalinaContext;
// create context
this.deploymentContext = new DefaultWarDeploymentContext(bundle, catalinaContext.getPath(),
catalinaContext.getServletContext());
}
代码示例来源:origin: jboss.web/jbossweb
public void setAsyncSupported(boolean asyncSupported) {
if (!context.isStarting()) {
throw new IllegalStateException(sm.getString("filterRegistration.ise", context.getPath()));
}
filterDef.setAsyncSupported(asyncSupported);
context.addFilterDef(filterDef);
}
代码示例来源:origin: org.apache.tomee/tomee-catalina
@Override
public boolean hasResourcePermission(final Request request, final Response response,
final SecurityConstraint[] constraint,
final Context context) throws IOException {
return (Boolean) invoke(hasResourcePermissionMethod, request.getRequest(), response.getResponse(), constraint, context.getPath());
}
代码示例来源:origin: jboss.web/jbossweb
public Set<String> setServletSecurity(ServletSecurityElement servletSecurity) {
if (!((Context) wrapper.getParent()).isStarting()) {
throw new IllegalStateException(sm.getString
("servletRegistration.ise", ((Context) wrapper.getParent()).getPath()));
}
if (servletSecurity == null) {
throw new IllegalArgumentException(sm.getString("servletRegistration.iae"));
}
return wrapper.setServletSecurity(servletSecurity);
}
代码示例来源:origin: jboss.web/jbossweb
public void setLoadOnStartup(int loadOnStartup) {
if (!((Context) wrapper.getParent()).isStarting()) {
throw new IllegalStateException(sm.getString
("servletRegistration.ise", ((Context) wrapper.getParent()).getPath()));
}
wrapper.setLoadOnStartup(loadOnStartup);
}
代码示例来源:origin: org.jboss.web/jbossweb
public void setAsyncSupported(boolean asyncSupported) {
if (!context.isStarting()) {
throw MESSAGES.cannotAddFilterRegistrationAfterInit(context.getPath());
}
filterDef.setAsyncSupported(asyncSupported);
context.addFilterDef(filterDef);
}
代码示例来源:origin: org.apache.meecrowave/meecrowave-core
public String getFirstBase() {
return (connector.getSecure() ? "https" : "http") + "://" +
host.getName() + (connector.getPort() > 0 ? ":" + connector.getPort() : "") +
context.getPath();
}
}
代码示例来源:origin: org.jboss.web/jbossweb
public void setAsyncSupported(boolean asyncSupported) {
if (!((Context) wrapper.getParent()).isStarting()) {
throw MESSAGES.cannotAddServletRegistrationAfterInit(((Context) wrapper.getParent()).getPath());
}
wrapper.setAsyncSupported(asyncSupported);
}
代码示例来源:origin: org.jboss.web/jbossweb
public void setLoadOnStartup(int loadOnStartup) {
if (!((Context) wrapper.getParent()).isStarting()) {
throw MESSAGES.cannotAddServletRegistrationAfterInit(((Context) wrapper.getParent()).getPath());
}
wrapper.setLoadOnStartup(loadOnStartup);
}
代码示例来源:origin: org.jboss.web/jbossweb
public Set<String> setServletSecurity(ServletSecurityElement servletSecurity) {
if (!((Context) wrapper.getParent()).isStarting()) {
throw MESSAGES.cannotAddServletRegistrationAfterInit(((Context) wrapper.getParent()).getPath());
}
if (servletSecurity == null) {
throw MESSAGES.invalidServletRegistrationArguments();
}
return wrapper.setServletSecurity(servletSecurity);
}
代码示例来源:origin: org.jboss.web/jbossweb
public void setRunAsRole(String roleName) {
if (!((Context) wrapper.getParent()).isStarting()) {
throw MESSAGES.cannotAddServletRegistrationAfterInit(((Context) wrapper.getParent()).getPath());
}
if (roleName == null) {
throw MESSAGES.invalidServletRegistrationArguments();
}
wrapper.setRunAs(roleName);
}
代码示例来源:origin: org.mobicents.arquillian.container/mss-tomcat-embedded-6
@Override
public synchronized void removeContext(Context context) {
if( log.isDebugEnabled() )
log.debug("Removing context[" + context.getPath() + "]");
boolean isContextExists = isContextExists(context);
if(!isContextExists)
return;
// Remove this Context from the associated Host
if( log.isDebugEnabled() )
log.debug(" Removing this Context");
context.getParent().removeChild(context);
}
内容来源于网络,如有侵权,请联系作者删除!