Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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.

Field Summary

Fields inherited from class org.apache.tomcat.core.BaseInterceptor
`ct, ctx, debug, DECLINED, loghelper, OK`

Constructor Summary
`SimpleMapper1()`

Method Summary
`void` | `addContainer(Container ct)` Associate URL pattern to a set of propreties.
`void` | `addContext(ContextManager cm, Context ctx)` Called when a context is added.
`int` | `contextMap(Request req)` First step of request processing is finding the Context.
`void` | `engineInit(ContextManager cm)` Set the context manager.
`void` | `removeContainer(Container ct)` A rule was removed, update the internal strucures.
`void` | `removeContext(ContextManager cm, Context ctx)` Called when a context is removed from a CM - we must ask the mapper to remove all the maps related with this context
`void` | `setIgnoreCase(boolean b)` Use case insensitive match, for windows and similar platforms
`void` | `setMapCache(boolean v)` Allow the mapper to cache mapping results - resulting in a faster match for frequent requests.

Methods inherited from class org.apache.tomcat.core.BaseInterceptor
`addHandler, addInterceptor, addSecurityConstraint, afterBody, authenticate, authorize, beforeBody, beforeCommit, contextInit, contextShutdown, contextState, copyContext, engineShutdown, engineStart, engineState, engineStop, findSession, getContext, getContextManager, getDebug, getInfo, getLog, getNote, getNote, handleError, log, log, log, log, postInitCheck, postReadRequest, postRequest, postService, postServletDestroy, postServletInit, preInitCheck, 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`

Constructor Detail

### SimpleMapper1

    public SimpleMapper1()

Method Detail

### 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`
  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`
  Throws:
    `TomcatException`

### 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`
  Throws:
    `TomcatException`

### 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`
  Throws:
    `TomcatException`

### 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`
  Throws:
    `TomcatException`

### contextMap

    public int contextMap(Request req)

  First step of request processing is finding the Context.

  Overrides:
    `contextMap` in class `BaseInterceptor`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001 Apache Software Foundation. All Rights Reserved.