📄 velocity_freemarker.apt
字号:
~~ FCKeditor - The text editor for Internet - http://www.fckeditor.net~~ Copyright (C) 2003-2008 Frederico Caldeira Knabben~~~~ == BEGIN LICENSE ==~~~~ Licensed under the terms of any of the following licenses at your~~ choice:~~~~ - GNU General Public License Version 2 or later (the "GPL")~~ http://www.gnu.org/licenses/gpl.html~~~~ - GNU Lesser General Public License Version 2.1 or later (the "LGPL")~~ http://www.gnu.org/licenses/lgpl.html~~~~ - Mozilla Public License Version 1.1 or later (the "MPL")~~ http://www.mozilla.org/MPL/MPL-1.1.html~~~~ == END LICENSE ==~~ @version $Id: velocity_freemarker.apt 2191 2008-07-08 18:14:52Z mosipov $ ------------------------------ Velocity/FreeMarker Integration ------------------------------ Integration with Velocity or FreeMarker {{{http://velocity.apache.org}Velocity}} and {{{http://freemarker.org}FreeMarker}} are quite similar and serve similar needs, they are discussed together in this section. [Hint:] This part of the documentation is just for those who are familiar with Velocity or FreeMarker. It's just a hint for an approach on how to use the Java Integration Pack with these template engines! The required jars are <<<velocity-1.x.x.jar>>> or <<<freemarker-2.x.jar>>> in order to work with Velocity or FreeMarker respectively and <<<commons-collections.jar>>> also has to be available for Velocity. Drop the required jar files in your classpath (usually <<<WEB-INF/lib>>>). The main class that builds the html for the editor is {{{java-core/apidocs/net/fckeditor/FCKeditor.html}<<<net.fckeditor.FCKeditor>>>}}. We propose to write a wrapper object to initialize the FCKeditor object.\ Take a look at this very simple example: +------------------------------------------------------------------------------+public class FCKeditorWrapper { private HttpServletRequest request; public FCKeditorWrapper(final HttpServletRequest request) { this.request = request; } public String get(final String instanceName, final String value) { FCKeditor editor = new FCKeditor(request, instanceName); editor.setValue(value); return editor.createHtml(); }}+------------------------------------------------------------------------------+ Let's assume you add a <<<FCKeditorWrapper>>> instance called <editor> to your context objects, then you just need the following minimal template example (Velocity):+------------------------------------------------------------------------------+<form method="post" action="[servlet path]"> $editor.get("DefaultEditor", "Some text"); <input type="submit" value="OK" /></form>+------------------------------------------------------------------------------+
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -