类 ViewImportSupport
java.lang.Object
org.apache.velocity.tools.generic.SafeConfig
org.apache.velocity.tools.generic.ImportSupport
org.apache.velocity.tools.view.ViewImportSupport
Provides methods to import arbitrary local or remote resources as strings.
Based on ImportSupport from the JSTL taglib by Shawn Bayern
- 从以下版本开始:
- VelocityTools 3.0
- 版本:
- $Revision$ $Date$
- 作者:
- Marino A. Jonsson, Claude Brisson
-
嵌套类概要
嵌套类修饰符和类型类说明protected static classWraps responses to allow us to retrieve results as Strings.protected static class -
字段概要
字段修饰符和类型字段说明protected jakarta.servlet.ServletContextprotected jakarta.servlet.http.HttpServletRequestprotected jakarta.servlet.http.HttpServletResponse从类继承的字段 org.apache.velocity.tools.generic.ImportSupport
RESOURCE_KEY, URL_KEY, VALID_SCHEME_CHARS从类继承的字段 org.apache.velocity.tools.generic.SafeConfig
LOCK_CONFIG_KEY, log, LOGGER_NAME_KEY, SAFE_MODE_KEY, USE_CLASS_LOGGER_KEY -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected Readerprotected Stringprotected Readerprotected Stringprotected voidconfigure(ValueParser values) protected URLgetFileResource(String resource) protected StringmergeQueryStrings(String url) Merge original parameters into the query stringvoidsetRequest(jakarta.servlet.http.HttpServletRequest request) Sets the currentHttpServletRequest.voidsetResponse(jakarta.servlet.http.HttpServletResponse response) Sets the currentHttpServletResponse.voidsetServletContext(jakarta.servlet.ServletContext application) Sets theServletContext.static StringstripSession(String url) Strips a servlet session ID from url.从类继承的方法 org.apache.velocity.tools.generic.ImportSupport
acquireReader, acquireString, getClasspathResource, getContentTypeAttribute, getProtocol, getResourceReader, getResourceString, isRemoteURL, setSafeMode从类继承的方法 org.apache.velocity.tools.generic.SafeConfig
configure, getLog, initLogger, isConfigLocked, isSafeMode, setLockConfig
-
字段详细资料
-
application
protected jakarta.servlet.ServletContext application -
request
protected jakarta.servlet.http.HttpServletRequest request -
response
protected jakarta.servlet.http.HttpServletResponse response
-
-
构造器详细资料
-
ViewImportSupport
public ViewImportSupport()
-
-
方法详细资料
-
configure
- 覆盖:
configure在类中ImportSupport
-
setRequest
public void setRequest(jakarta.servlet.http.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.- 参数:
request- servlet request
-
setResponse
public void setResponse(jakarta.servlet.http.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.- 参数:
response- servlet response
-
setServletContext
public void setServletContext(jakarta.servlet.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.- 参数:
application- servlet context
-
acquireRemoteURLString
- 覆盖:
acquireRemoteURLString在类中ImportSupport- 参数:
url- the remote URL resource to return as string- 返回:
- the URL resource as string
- 抛出:
IOException- if thrown by underlying code
-
acquireLocalURLString
- 覆盖:
acquireLocalURLString在类中ImportSupport- 参数:
url- the local URL resource to return as string- 返回:
- the URL resource as string
- 抛出:
IOException- if not allowed or if thrown by underlying code
-
acquireRemoteURLReader
- 覆盖:
acquireRemoteURLReader在类中ImportSupport- 参数:
url- the URL to read- 返回:
- a Reader for the InputStream created from the supplied URL
- 抛出:
IOException- if not allowed or thrown by underlying code
-
acquireLocalURLReader
- 覆盖:
acquireLocalURLReader在类中ImportSupport- 参数:
url- the URL to read- 返回:
- a Reader for the InputStream created from the supplied URL
- 抛出:
IOException- if thrown by underlying code
-
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
-
mergeQueryStrings
Merge original parameters into the query string- 参数:
url- the url to include- 返回:
- the merged url
-
getFileResource
- 覆盖:
getFileResource在类中ImportSupport- 抛出:
Exception
-