public class ServletContextUriLocator extends WildcardUriLocatorSupport
Context instance should be
available in the ThreadLocal associated with the thread invoking this locator.| Modifier and Type | Class and Description |
|---|---|
static class |
ServletContextUriLocator.LocatorStrategy
Available LocatorStrategies.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
ALIAS
Alias used to register this locator with
LocatorProvider. |
static String |
ALIAS_DISPATCHER_FIRST
Same as default Alias (exist for explicit configuration).
|
static String |
ALIAS_SERVLET_CONTEXT_FIRST
Uses SERVLET_CONTEXT_FIRST strategy, meaning that, for example, a jsp will be served with its raw content, instead
of processed by container.
|
static String |
ALIAS_SERVLET_CONTEXT_ONLY
Uses SERVLET_CONTEXT_ONLY strategy, meaning that no dispatching will be performed when there is no servletContext
resource available.
|
static String |
PREFIX
Prefix for url resources.
|
| Constructor and Description |
|---|
ServletContextUriLocator() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(String uri)
Check if this uri can be located by concrete implementation.
|
ServletContextUriLocator.LocatorStrategy |
getLocatorStrategy() |
static boolean |
isProtectedResource(String uri)
Check If the uri of the resource is protected: it cannot be accessed by accessing the url directly (WEB-INF
folder).
|
static boolean |
isValid(String uri)
Check if a uri is a servletContext resource.
|
InputStream |
locate(String uri)
Locates the uri by retrieving the InputStream.
|
ServletContextUriLocator |
setLocatorStrategy(ServletContextUriLocator.LocatorStrategy locatorStrategy)
Sets the locator strategy to use.
|
getWildcardStreamLocator, isEnableWildcards, newWildcardStreamLocator, setEnableWildcardspublic static final String ALIAS
LocatorProvider.public static final String ALIAS_DISPATCHER_FIRST
public static final String ALIAS_SERVLET_CONTEXT_FIRST
public static final String ALIAS_SERVLET_CONTEXT_ONLY
public static final String PREFIX
public ServletContextUriLocator setLocatorStrategy(ServletContextUriLocator.LocatorStrategy locatorStrategy)
public boolean accept(String uri)
uri - to read.public static boolean isValid(String uri)
uri - to check.public static boolean isProtectedResource(String uri)
uri - the uri to check.public InputStream locate(String uri) throws IOException
uri - uri to read.IOException - if the resource cannot be read for some reason.public ServletContextUriLocator.LocatorStrategy getLocatorStrategy()
Copyright © 2008-2014. All Rights Reserved.