类 ImportTool

java.lang.Object
org.apache.velocity.tools.generic.SafeConfig
org.apache.velocity.tools.generic.ImportTool
所有已实现的接口:
Serializable

@DefaultKey("import") @ValidScope("request") public class ImportTool extends SafeConfig implements Serializable
General-purpose text-importing tool for templates.

Usage: just call $import.read("http://www.foo.com/bleh.jsp?sneh=bar") to insert the contents of the named resource into the template.

Toolbox configuration:

 <tools>
   <toolbox scope="request">
     <tool class="org.apache.velocity.tools.view.ImportTool"/>
   </toolbox>
 </tools>
 
从以下版本开始:
VelocityTools 3.0
版本:
$Id$
作者:
Marino A. Jonsson
另请参阅:
  • 字段详细资料

    • importSupport

      protected transient ImportSupport importSupport
      ImportSupport utility which provides underlying i/o
  • 构造器详细资料

    • ImportTool

      public ImportTool()
  • 方法详细资料

    • initializeImportSupport

      protected void initializeImportSupport(ValueParser config)
      Importsupport initialization
      参数:
      config - configuration values
    • configure

      protected void configure(ValueParser values)
      Configuration
      覆盖:
      configure 在类中 SafeConfig
      参数:
      values - configuration values
    • read

      public String read(String resource)
      Returns the supplied resource rendered as a String.
      参数:
      resource - the URL to import
      返回:
      the URL as a string
    • fetch

      public String fetch(String url)
      Returns the supplied URL rendered as a String.
      参数:
      url - the URL to import
      返回:
      the URL as a string