| java.lang.Object com.caucho.server.dispatch.UrlMap
UrlMap | public class UrlMap (Code) | | Maps uris to objects, using the syntax in the servlet2.2 deployment
descriptors:
/foo/bar -- exact match
/foo/bar/* -- matches anything with the /foo/bar prefix
.jsp -- matches anything with the .jsp suffix
|
Inner Class :static class RegexpEntry | |
Constructor Summary | |
public | UrlMap() | public | UrlMap(boolean bestShort) Create a new map preferring a short match. |
Method Summary | |
public void | addMap(String pattern, E value) | public void | addMap(String pattern, String flags, E value) | public void | addRegexp(String regexp, String flags, E value) | public void | addRegexp(String regexp, E value) | public void | addRegexp(int prefixLength, String regexp, String flags, E value, boolean isShort) Adds a regular expression to the map. | public void | addRegexp(int prefixLength, String pattern, String regexp, String flags, E value, boolean isShort) Adds a regular expression to the map. | public void | addStrictMap(String pattern, String flags, E value) | public ArrayList<String> | getURLPatterns() Return the matching url patterns. | public E | map(String uri) Finds the best match for the uri. | public E | map(String uri, ArrayList<String> vars) Finds the best match for the uri. | void | setBestShort(boolean bestShort) If set to true, this map uses the shortest match instead of the
longest. | int | size() | public static String | urlPatternToRegexpPattern(String pattern) |
UrlMap | public UrlMap()(Code) | | Create a new map
|
UrlMap | public UrlMap(boolean bestShort)(Code) | | Create a new map preferring a short match.
Parameters: bestShort - if true, use the shortest match |
addMap | public void addMap(String pattern, String flags, E value) throws PatternSyntaxException(Code) | | Adds a new url-pattern and its corresponding value to the map
Parameters: pattern - servlet2.2 url-pattern Parameters: value - object stored as the value |
addRegexp | public void addRegexp(int prefixLength, String regexp, String flags, E value, boolean isShort) throws PatternSyntaxException(Code) | | Adds a regular expression to the map.
Parameters: prefixLength - the length of the pattern's mandatory prefix Parameters: regexp - the regexp pattern to add Parameters: flags - regexp flags, like "i" for case insensitive Parameters: value - the value for matching the pattern Parameters: isShort - if true, this regexp expects to be shorter than others |
addRegexp | public void addRegexp(int prefixLength, String pattern, String regexp, String flags, E value, boolean isShort) throws PatternSyntaxException(Code) | | Adds a regular expression to the map.
Parameters: prefixLength - the length of the pattern's mandatory prefix Parameters: pattern - the regexp pattern to add Parameters: regexp - the regexp pattern to add Parameters: flags - regexp flags, like "i" for case insensitive Parameters: value - the value for matching the pattern Parameters: isShort - if true, this regexp expects to be shorter than others |
addStrictMap | public void addStrictMap(String pattern, String flags, E value) throws PatternSyntaxException, ServletException(Code) | | Adds a new url-pattern and its corresponding value to the map
Parameters: pattern - servlet2.2 url-pattern Parameters: value - object stored as the value |
map | public E map(String uri)(Code) | | Finds the best match for the uri. In the case of a servlet dispatch,
match is servletPath and replacement is pathInfo.
Parameters: uri - uri to match matching object |
map | public E map(String uri, ArrayList<String> vars)(Code) | | Finds the best match for the uri. In the case of a servlet dispatch,
match is servletPath and replacement is pathInfo.
Parameters: uri - uri to match Parameters: vars - a list of the regexp variables. matching object |
setBestShort | void setBestShort(boolean bestShort)(Code) | | If set to true, this map uses the shortest match instead of the
longest.
Parameters: bestShort - if true, use the shortest match |
urlPatternToRegexpPattern | public static String urlPatternToRegexpPattern(String pattern)(Code) | | |
|
|