org.apache.velocity.tools.view.tools
Class ImportTool
java.lang.Object
org.apache.velocity.tools.view.ImportSupport
org.apache.velocity.tools.view.tools.ImportTool
public class ImportTool
- extends ImportSupport
General-purpose text-importing view 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:
<tool>
<key>import</key>
<scope>request</scope>
<class>org.apache.velocity.tools.view.tools.ImportTool</class>
</tool>
- Since:
- VelocityTools 1.1
- Version:
- $Revision: 477914 $ $Date: 2006-11-21 13:52:11 -0800 (Tue, 21 Nov 2006) $
- Author:
- Marino A. Jonsson
Field Summary |
protected static org.apache.commons.logging.Log |
LOG
|
Constructor Summary |
ImportTool()
Default constructor. |
Method Summary |
void |
init(java.lang.Object obj)
Initializes this tool. |
java.lang.String |
read(java.lang.String url)
Returns the supplied URL rendered as a String. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG
protected static final org.apache.commons.logging.Log LOG
ImportTool
public ImportTool()
- Default constructor. Tool must be initialized before use.
init
public void init(java.lang.Object obj)
- Initializes this tool.
- Parameters:
obj
- the current ViewContext
- Throws:
java.lang.IllegalArgumentException
- if the param is not a ViewContext
read
public java.lang.String read(java.lang.String url)
- Returns the supplied URL rendered as a String.
- Parameters:
url
- the URL to import
- Returns:
- the URL as a string
Copyright (c) 2003-2007 Apache Software Foundation