类 ImportSupport
java.lang.Object
org.apache.velocity.tools.view.ImportSupport
- 直接已知子类:
ImportTool
,TilesTool
Provides methods to import arbitrary local or remote resources as strings.
Based on ImportSupport from the JSTL taglib by Shawn Bayern
- 从以下版本开始:
- VelocityTools 2.0
- 版本:
- $Revision: 591088 $ $Date: 2007-11-01 10:11:41 -0700 (Thu, 01 Nov 2007) $
- 作者:
- Marino A. Jonsson
-
嵌套类概要
嵌套类修饰符和类型类说明protected static class
Wraps responses to allow us to retrieve results as Strings.protected static class
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明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 currentHttpServletRequest
.void
setResponse
(HttpServletResponse response) Sets the currentHttpServletResponse
.void
setServletContext
(ServletContext application) Sets theServletContext
.static String
stripSession
(String url) Strips a servlet session ID from url.
-
字段详细资料
-
构造器详细资料
-
ImportSupport
public ImportSupport()
-
-
方法详细资料
-
setLog
public void setLog(org.apache.velocity.runtime.log.Log log) -
setRequest
public void setRequest(HttpServletRequest request) Sets the currentHttpServletRequest
. This is required for this tool to operate and will throw a NullPointerException if this is not set or is set tonull
. -
setResponse
public void setResponse(HttpServletResponse response) Sets the currentHttpServletResponse
. This is required for this tool to operate and will throw a NullPointerException if this is not set or is set tonull
. -
setServletContext
public void setServletContext(ServletContext application) Sets theServletContext
. This is required for this tool to operate and will throw a NullPointerException if this is not set or is set tonull
. -
acquireString
- 参数:
url
- the URL resource to return as string- 返回:
- the URL resource as string
- 抛出:
IOException
Exception
-
acquireReader
- 参数:
url
- the URL to read- 返回:
- a Reader for the InputStream created from the supplied URL
- 抛出:
IOException
Exception
-
isAbsoluteUrl
Returns true if our current URL is absolute, false otherwise.- 参数:
url
- the url to check out- 返回:
- true if the url is absolute
-
stripSession
Strips a servlet session ID from url. The session ID is encoded as a URL "path parameter" beginning with "jsessionid=". We thus remove anything we find between ";jsessionid=" (inclusive) and either EOS or a subsequent ';' (exclusive).- 参数:
url
- the url to strip the session id from- 返回:
- the stripped url
-
getContentTypeAttribute
Get the value associated with a content-type attribute. Syntax defined in RFC 2045, section 5.1.- 参数:
input
- the string containing the attributesname
- the name of the content-type attribute- 返回:
- the value associated with a content-type attribute
-