velocity 에서 사용
ImportTool 사용:
원본 주소:http://velocity.apache.org/tools/devel/view/ImportTool.html
다음은 인용:
ImportTool Reference Documentation
General-purpose text-importing view tool for templates.
Class
org.apache.velocity.tools.view.tools.ImportTool
Name
$import (this is the recommended name of the tool in the Velocity context)
Toolbox Configuration Example
<tool>
<key>import</key>
<scope>request</scope>
<class>org.apache.velocity.tools.view.tools.ImportTool</class>
</tool>
Author(s)
Marino A. Jonsson
Method Overview
read()
Returns the supplied URL rendered as a String.
read()
Returns the supplied URL rendered as a String.
String read(String url)
Parameters
url
The URL to import.
Returns
The supplied URL rendered as a String.
This method takes an arbitrary URL or URI and renders it as a String. This tool can also be used to import local .vm resources without sharing the current velocity-context (as opposed to the #parse directive).
$import.read("http://velocity.apache.org/tools/devel/")
$import.read("/wookie.jsp")
velocity tools 의 설 치 를 보십시오:
원본 주소:http://velocity.apache.org/tools/devel/view/index.html#Installation
다음은 인용:
The servlet configuration (web.xml ) must be modified to include a reference to the VelocityViewServlet (or subclass thereof) which will perform the rendering. All *.vm files are mapped to this servlet which will populate the 'context' with Request, Session, and Application scopes plus any additional tools specified in the toolbox.xml file. The servlet will use this contextual information and the Velocity Engine to render the template file.
Note: Additional functionality can be achieved through subclassing the VelocityViewServlet, and will be discussed further in the VelocityLayoutServlet below.
web.xml
<!-- Define Velocity template compiler -->
<servlet>
<servlet-name>velocity</servlet-name>
<servlet-class>
org.apache.velocity.tools.view.servlet.VelocityViewServlet
</servlet-class>
<!--
Unless you plan to put your toolbox.xml and velocity.properties
under different folders or give them different names, then these
two init-params are unnecessary as of VelocityTools 1.3. The
VelocityViewServlet will automatically look for these files in
the following locations.
-->
<init-param>
<param-name>org.apache.velocity.toolbox</param-name>
<param-value>/WEB-INF/toolbox.xml</param-value>
</init-param>
<init-param>
<param-name>org.apache.velocity.properties</param-name>
<param-value>/WEB-INF/velocity.properties</param-value>
</init-param>
</servlet>
<!-- Map *.vm files to Velocity -->
<servlet-mapping>
<servlet-name>velocity</servlet-name>
<url-pattern>*.vm</url-pattern>
</servlet-mapping>
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Visual Studio에서 파일 폴더 구분 (포함 경로 설정)Visual Studio에서 c, cpp, h, hpp 파일을 폴더로 나누고 싶었습니까? 어쩌면 대부분의 사람들이 있다고 생각합니다. 처음에 파일이 만들어지는 장소는 프로젝트 파일 등과 같은 장소에 있기 때문에 파일...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.