|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 javax.servlet.ServletContext |
application
|
protected static java.lang.String |
DEFAULT_ENCODING
Default character encoding for response. |
protected org.apache.velocity.runtime.log.Log |
LOG
|
protected javax.servlet.http.HttpServletRequest |
request
|
protected javax.servlet.http.HttpServletResponse |
response
|
protected static java.lang.String |
VALID_SCHEME_CHARS
|
Constructor Summary | |
---|---|
ImportSupport()
|
Method Summary | |
---|---|
protected java.io.Reader |
acquireReader(java.lang.String url)
|
protected java.lang.String |
acquireString(java.lang.String url)
|
static java.lang.String |
getContentTypeAttribute(java.lang.String input,
java.lang.String name)
Get the value associated with a content-type attribute. |
static boolean |
isAbsoluteUrl(java.lang.String url)
Returns true if our current URL is absolute, false otherwise. |
void |
setLog(org.apache.velocity.runtime.log.Log log)
|
void |
setRequest(javax.servlet.http.HttpServletRequest request)
Sets the current HttpServletRequest . |
void |
setResponse(javax.servlet.http.HttpServletResponse response)
Sets the current HttpServletResponse . |
void |
setServletContext(javax.servlet.ServletContext application)
Sets the ServletContext . |
static java.lang.String |
stripSession(java.lang.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 java.lang.String VALID_SCHEME_CHARS
protected static final java.lang.String DEFAULT_ENCODING
protected org.apache.velocity.runtime.log.Log LOG
protected javax.servlet.ServletContext application
protected javax.servlet.http.HttpServletRequest request
protected javax.servlet.http.HttpServletResponse response
Constructor Detail |
---|
public ImportSupport()
Method Detail |
---|
public void setLog(org.apache.velocity.runtime.log.Log log)
public void setRequest(javax.servlet.http.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(javax.servlet.http.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(javax.servlet.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 java.lang.String acquireString(java.lang.String url) throws java.io.IOException, java.lang.Exception
url
- the URL resource to return as string
java.io.IOException
java.lang.Exception
protected java.io.Reader acquireReader(java.lang.String url) throws java.io.IOException, java.lang.Exception
url
- the URL to read
java.io.IOException
java.lang.Exception
public static boolean isAbsoluteUrl(java.lang.String url)
url
- the url to check out
public static java.lang.String stripSession(java.lang.String url)
url
- the url to strip the session id from
public static java.lang.String getContentTypeAttribute(java.lang.String input, java.lang.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 |