类 ViewImportSupport


public class ViewImportSupport extends ImportSupport

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
  • 字段详细资料

    • application

      protected jakarta.servlet.ServletContext application
    • request

      protected jakarta.servlet.http.HttpServletRequest request
    • response

      protected jakarta.servlet.http.HttpServletResponse response
  • 构造器详细资料

    • ViewImportSupport

      public ViewImportSupport()
  • 方法详细资料

    • configure

      protected void configure(ValueParser values)
      覆盖:
      configure 在类中 ImportSupport
    • setRequest

      public void setRequest(jakarta.servlet.http.HttpServletRequest request)
      Sets the current HttpServletRequest. This is required for this tool to operate and will throw a NullPointerException if this is not set or is set to null.
      参数:
      request - servlet request
    • setResponse

      public void setResponse(jakarta.servlet.http.HttpServletResponse response)
      Sets the current HttpServletResponse. This is required for this tool to operate and will throw a NullPointerException if this is not set or is set to null.
      参数:
      response - servlet response
    • setServletContext

      public void setServletContext(jakarta.servlet.ServletContext application)
      Sets the ServletContext. This is required for this tool to operate and will throw a NullPointerException if this is not set or is set to null.
      参数:
      application - servlet context
    • acquireRemoteURLString

      protected String acquireRemoteURLString(String url) throws IOException
      覆盖:
      acquireRemoteURLString 在类中 ImportSupport
      参数:
      url - the remote URL resource to return as string
      返回:
      the URL resource as string
      抛出:
      IOException - if thrown by underlying code
    • acquireLocalURLString

      protected String acquireLocalURLString(String url) throws IOException
      覆盖:
      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

      protected Reader acquireRemoteURLReader(String url) throws IOException
      覆盖:
      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

      protected Reader acquireLocalURLReader(String url) throws IOException
      覆盖:
      acquireLocalURLReader 在类中 ImportSupport
      参数:
      url - the URL to read
      返回:
      a Reader for the InputStream created from the supplied URL
      抛出:
      IOException - if thrown by underlying code
    • stripSession

      public static String stripSession(String url)
      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

      protected String mergeQueryStrings(String url)
      Merge original parameters into the query string
      参数:
      url - the url to include
      返回:
      the merged url
    • getFileResource

      protected URL getFileResource(String resource) throws Exception
      覆盖:
      getFileResource 在类中 ImportSupport
      抛出:
      Exception