org.apache.tomcat.modules.mappers
Class SimpleMapper1
java.lang.Object
|
+--org.apache.tomcat.core.BaseInterceptor
|
+--org.apache.tomcat.modules.mappers.SimpleMapper1
- public class SimpleMapper1
- extends BaseInterceptor
This class will set up the data structures used by a simple patern matching
algorithm and use it to extract the path components from the request URI.
This particular implementation does the following:
- extract the information that is relevant to matching from the Request
object. The current implementation deals with the Host header and the
request URI.
- Use an external mapper to find the best match.
- Adjust the request paths
SimpleMapper1 will set 2 context notes - "map.extensions" is a
SimpleHashtable containing the extension mappings, and "tomcat.map.default"
for the default map, if defined explicitely.
It will also maintain a global mapping structure for all prefix mappings,
including contexts.
The execution time is proportional with the number of hosts, number of
context, number of mappings and with the length of the request.
Methods inherited from class org.apache.tomcat.core.BaseInterceptor |
addHandler, addInterceptor, addSecurityConstraint, afterBody, authenticate, authorize, beforeBody, beforeCommit, contextInit, contextShutdown, contextState, engineShutdown, engineStart, engineState, engineStop, findSession, getContext, getContextManager, getDebug, getInfo, getLog, getNote, getNote, handleError, log, log, log, log, postReadRequest, postRequest, postService, postServletDestroy, postServletInit, preService, preServletDestroy, preServletInit, registerHooks, reload, removeHandler, removeInterceptor, requestMap, sessionState, setContext, setContextManager, setDebug, setInfo, setNote, setNote |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleMapper1
public SimpleMapper1()
setMapCache
public void setMapCache(boolean v)
- Allow the mapper to cache mapping results - resulting in a
faster match for frequent requests. ( treat this as experimental)
setIgnoreCase
public void setIgnoreCase(boolean b)
- Use case insensitive match, for windows and
similar platforms
engineInit
public void engineInit(ContextManager cm)
throws TomcatException
- Set the context manager. To keep it simple we don't support
dynamic add/remove for this interceptor.
- Overrides:
engineInit
in class BaseInterceptor
- Following copied from class:
org.apache.tomcat.core.BaseInterceptor
- Throws:
TomcatException
- The module will not be added if any
exception is thrown by engineInit.
addContext
public void addContext(ContextManager cm,
Context ctx)
throws TomcatException
- Called when a context is added.
- Overrides:
addContext
in class BaseInterceptor
removeContext
public void removeContext(ContextManager cm,
Context ctx)
throws TomcatException
- Called when a context is removed from a CM - we must ask the mapper to
remove all the maps related with this context
- Overrides:
removeContext
in class BaseInterceptor
addContainer
public void addContainer(Container ct)
throws TomcatException
- Associate URL pattern to a set of propreties.
Note that the order of resolution to handle a request is:
exact mapped servlet (eg /catalog)
prefix mapped servlets (eg /foo/bar/*)
extension mapped servlets (eg *jsp)
default servlet
- Overrides:
addContainer
in class BaseInterceptor
removeContainer
public void removeContainer(Container ct)
throws TomcatException
- Description copied from class:
BaseInterceptor
- A rule was removed, update the internal strucures. You can also
clean up and reload everything using Context.getContainers()
- Overrides:
removeContainer
in class BaseInterceptor
contextMap
public int contextMap(Request req)
- First step of request processing is finding the Context.
- Overrides:
contextMap
in class BaseInterceptor
Copyright © 2001 Apache Software Foundation. All Rights Reserved.