Package org.apache.catalina.mapper
Class Mapper
- java.lang.Object
-
- org.apache.catalina.mapper.Mapper
-
public final class Mapper extends java.lang.Object
Mapper, which implements the servlet API mapping rules (which are derived from the HTTP rules).- Author:
- Remy Maucherat
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
Mapper.ContextList
protected static class
Mapper.ContextVersion
protected static class
Mapper.MapElement<T>
protected static class
Mapper.MappedContext
protected static class
Mapper.MappedHost
protected static class
Mapper.MappedWrapper
-
Constructor Summary
Constructors Constructor Description Mapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addContextVersion(java.lang.String hostName, Host host, java.lang.String path, java.lang.String version, Context context, java.lang.String[] welcomeResources, WebResourceRoot resources, java.util.Collection<WrapperMappingInfo> wrappers)
Add a new Context to an existing Host.void
addHost(java.lang.String name, java.lang.String[] aliases, Host host)
Add a new host to the mapper.void
addHostAlias(java.lang.String name, java.lang.String alias)
Add an alias to an existing host.void
addWelcomeFile(java.lang.String hostName, java.lang.String contextPath, java.lang.String version, java.lang.String welcomeFile)
Add a welcome file to the given context.void
addWrapper(java.lang.String hostName, java.lang.String contextPath, java.lang.String version, java.lang.String path, Wrapper wrapper, boolean jspWildCard, boolean resourceOnly)
protected void
addWrapper(Mapper.ContextVersion context, java.lang.String path, Wrapper wrapper, boolean jspWildCard, boolean resourceOnly)
Adds a wrapper to the given context.void
addWrappers(java.lang.String hostName, java.lang.String contextPath, java.lang.String version, java.util.Collection<WrapperMappingInfo> wrappers)
void
clearWelcomeFiles(java.lang.String hostName, java.lang.String contextPath, java.lang.String version)
Clear the welcome files for the given context.void
map(Context context, MessageBytes uri, MappingData mappingData)
Map the specified URI relative to the context, mutating the given mapping data.void
map(MessageBytes host, MessageBytes uri, java.lang.String version, MappingData mappingData)
Map the specified host name and URI, mutating the given mapping data.void
pauseContextVersion(Context ctxt, java.lang.String hostName, java.lang.String contextPath, java.lang.String version)
Mark a context as being reloaded.void
removeContextVersion(Context ctxt, java.lang.String hostName, java.lang.String path, java.lang.String version)
Remove a context from an existing host.void
removeHost(java.lang.String name)
Remove a host from the mapper.void
removeHostAlias(java.lang.String alias)
Remove a host aliasvoid
removeWelcomeFile(java.lang.String hostName, java.lang.String contextPath, java.lang.String version, java.lang.String welcomeFile)
Remove a welcome file from the given context.void
removeWrapper(java.lang.String hostName, java.lang.String contextPath, java.lang.String version, java.lang.String path)
Remove a wrapper from an existing context.protected void
removeWrapper(Mapper.ContextVersion context, java.lang.String path)
void
setDefaultHostName(java.lang.String defaultHostName)
Set default host.
-
-
-
Method Detail
-
setDefaultHostName
public void setDefaultHostName(java.lang.String defaultHostName)
Set default host.- Parameters:
defaultHostName
- Default host name
-
addHost
public void addHost(java.lang.String name, java.lang.String[] aliases, Host host)
Add a new host to the mapper.- Parameters:
name
- Virtual host namealiases
- Alias names for the virtual hosthost
- Host object
-
removeHost
public void removeHost(java.lang.String name)
Remove a host from the mapper.- Parameters:
name
- Virtual host name
-
addHostAlias
public void addHostAlias(java.lang.String name, java.lang.String alias)
Add an alias to an existing host.- Parameters:
name
- The name of the hostalias
- The alias to add
-
removeHostAlias
public void removeHostAlias(java.lang.String alias)
Remove a host alias- Parameters:
alias
- The alias to remove
-
addContextVersion
public void addContextVersion(java.lang.String hostName, Host host, java.lang.String path, java.lang.String version, Context context, java.lang.String[] welcomeResources, WebResourceRoot resources, java.util.Collection<WrapperMappingInfo> wrappers)
Add a new Context to an existing Host.- Parameters:
hostName
- Virtual host name this context belongs tohost
- Host objectpath
- Context pathversion
- Context versioncontext
- Context objectwelcomeResources
- Welcome files defined for this contextresources
- Static resources of the contextwrappers
- Information on wrapper mappings
-
removeContextVersion
public void removeContextVersion(Context ctxt, java.lang.String hostName, java.lang.String path, java.lang.String version)
Remove a context from an existing host.- Parameters:
ctxt
- The actual contexthostName
- Virtual host name this context belongs topath
- Context pathversion
- Context version
-
pauseContextVersion
public void pauseContextVersion(Context ctxt, java.lang.String hostName, java.lang.String contextPath, java.lang.String version)
Mark a context as being reloaded. Reversion of this state is performed by callingaddContextVersion(...)
when context starts up.- Parameters:
ctxt
- The actual contexthostName
- Virtual host name this context belongs tocontextPath
- Context pathversion
- Context version
-
addWrapper
public void addWrapper(java.lang.String hostName, java.lang.String contextPath, java.lang.String version, java.lang.String path, Wrapper wrapper, boolean jspWildCard, boolean resourceOnly)
-
addWrappers
public void addWrappers(java.lang.String hostName, java.lang.String contextPath, java.lang.String version, java.util.Collection<WrapperMappingInfo> wrappers)
-
addWrapper
protected void addWrapper(Mapper.ContextVersion context, java.lang.String path, Wrapper wrapper, boolean jspWildCard, boolean resourceOnly)
Adds a wrapper to the given context.- Parameters:
context
- The context to which to add the wrapperpath
- Wrapper mappingwrapper
- The Wrapper objectjspWildCard
- true if the wrapper corresponds to the JspServlet and the mapping path contains a wildcard; false otherwiseresourceOnly
- true if this wrapper always expects a physical resource to be present (such as a JSP)
-
removeWrapper
public void removeWrapper(java.lang.String hostName, java.lang.String contextPath, java.lang.String version, java.lang.String path)
Remove a wrapper from an existing context.- Parameters:
hostName
- Virtual host name this wrapper belongs tocontextPath
- Context path this wrapper belongs toversion
- Context version this wrapper belongs topath
- Wrapper mapping
-
removeWrapper
protected void removeWrapper(Mapper.ContextVersion context, java.lang.String path)
-
addWelcomeFile
public void addWelcomeFile(java.lang.String hostName, java.lang.String contextPath, java.lang.String version, java.lang.String welcomeFile)
Add a welcome file to the given context.- Parameters:
hostName
- The host where the given context can be foundcontextPath
- The path of the given contextversion
- The version of the given contextwelcomeFile
- The welcome file to add
-
removeWelcomeFile
public void removeWelcomeFile(java.lang.String hostName, java.lang.String contextPath, java.lang.String version, java.lang.String welcomeFile)
Remove a welcome file from the given context.- Parameters:
hostName
- The host where the given context can be foundcontextPath
- The path of the given contextversion
- The version of the given contextwelcomeFile
- The welcome file to remove
-
clearWelcomeFiles
public void clearWelcomeFiles(java.lang.String hostName, java.lang.String contextPath, java.lang.String version)
Clear the welcome files for the given context.- Parameters:
hostName
- The host where the context to be cleared can be foundcontextPath
- The path of the context to be clearedversion
- The version of the context to be cleared
-
map
public void map(MessageBytes host, MessageBytes uri, java.lang.String version, MappingData mappingData) throws java.io.IOException
Map the specified host name and URI, mutating the given mapping data.- Parameters:
host
- Virtual host nameuri
- URIversion
- The version, if any, included in the request to be mappedmappingData
- This structure will contain the result of the mapping operation- Throws:
java.io.IOException
- if the buffers are too small to hold the results of the mapping.
-
map
public void map(Context context, MessageBytes uri, MappingData mappingData) throws java.io.IOException
Map the specified URI relative to the context, mutating the given mapping data.- Parameters:
context
- The actual contexturi
- URImappingData
- This structure will contain the result of the mapping operation- Throws:
java.io.IOException
- if the buffers are too small to hold the results of the mapping.
-
-