Package org.apache.velocity.tools.view
Class ImportTool
- java.lang.Object
-
- org.apache.velocity.tools.generic.SafeConfig
-
- org.apache.velocity.tools.generic.ImportTool
-
- org.apache.velocity.tools.view.ImportTool
-
- All Implemented Interfaces:
java.io.Serializable
@DefaultKey("import") @ValidScope("request") public class ImportTool extends org.apache.velocity.tools.generic.ImportToolGeneral-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: <tools> <toolbox scope="request"> <tool class="org.apache.velocity.tools.view.ImportTool"/> </toolbox> </tools>- Since:
- VelocityTools 2.0
- Version:
- $Revision$ $Date$
- Author:
- Marino A. Jonsson
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ImportTool()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigure(org.apache.velocity.tools.generic.ValueParser values)protected voidinitializeImportSupport(org.apache.velocity.tools.generic.ValueParser config)java.lang.Stringread(java.lang.Object obj)Returns the supplied URL rendered as a String.
-
-
-
Method Detail
-
initializeImportSupport
protected void initializeImportSupport(org.apache.velocity.tools.generic.ValueParser config)
- Overrides:
initializeImportSupportin classorg.apache.velocity.tools.generic.ImportTool
-
configure
protected void configure(org.apache.velocity.tools.generic.ValueParser values)
- Overrides:
configurein classorg.apache.velocity.tools.generic.ImportTool
-
read
public java.lang.String read(java.lang.Object obj)
Returns the supplied URL rendered as a String.- Parameters:
obj- the URL to import- Returns:
- the URL as a string
-
-