|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.velocity.tools.view.ImportSupport
public abstract class ImportSupport
Provides methods to import arbitrary local or remote resources as strings.
Based on ImportSupport from the JSTL taglib by Shawn Bayern
| Nested Class Summary | |
|---|---|
protected static class |
ImportSupport.ImportResponseWrapper
Wraps responses to allow us to retrieve results as Strings. |
protected static class |
ImportSupport.SafeClosingHttpURLConnectionReader
|
| Field Summary | |
|---|---|
protected ServletContext |
application
|
protected static String |
DEFAULT_ENCODING
Default character encoding for response. |
protected org.apache.velocity.runtime.log.Log |
LOG
|
protected HttpServletRequest |
request
|
protected HttpServletResponse |
response
|
protected static String |
VALID_SCHEME_CHARS
|
| Constructor Summary | |
|---|---|
ImportSupport()
|
|
| Method Summary | |
|---|---|
protected Reader |
acquireReader(String url)
|
protected String |
acquireString(String url)
|
static String |
getContentTypeAttribute(String input,
String name)
Get the value associated with a content-type attribute. |
static boolean |
isAbsoluteUrl(String url)
Returns true if our current URL is absolute, false otherwise. |
void |
setLog(org.apache.velocity.runtime.log.Log log)
|
void |
setRequest(HttpServletRequest request)
Sets the current HttpServletRequest. |
void |
setResponse(HttpServletResponse response)
Sets the current HttpServletResponse. |
void |
setServletContext(ServletContext application)
Sets the ServletContext. |
static String |
stripSession(String url)
Strips a servlet session ID from url. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String VALID_SCHEME_CHARS
protected static final String DEFAULT_ENCODING
protected org.apache.velocity.runtime.log.Log LOG
protected ServletContext application
protected HttpServletRequest request
protected HttpServletResponse response
| Constructor Detail |
|---|
public ImportSupport()
| Method Detail |
|---|
public void setLog(org.apache.velocity.runtime.log.Log log)
public void setRequest(HttpServletRequest request)
HttpServletRequest. This is required
for this tool to operate and will throw a NullPointerException
if this is not set or is set to null.
public void setResponse(HttpServletResponse response)
HttpServletResponse. This is required
for this tool to operate and will throw a NullPointerException
if this is not set or is set to null.
public void setServletContext(ServletContext application)
ServletContext. This is required
for this tool to operate and will throw a NullPointerException
if this is not set or is set to null.
protected String acquireString(String url)
throws IOException,
Exception
url - the URL resource to return as string
IOException
Exception
protected Reader acquireReader(String url)
throws IOException,
Exception
url - the URL to read
IOException
Exceptionpublic static boolean isAbsoluteUrl(String url)
url - the url to check out
public static String stripSession(String url)
url - the url to strip the session id from
public static String getContentTypeAttribute(String input,
String name)
input - the string containing the attributesname - the name of the content-type attribute
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||