Ckeditor编辑器在JAVA中的使用与配置
来源:互联网 发布:linux 网卡驱动 编辑:程序博客网 时间:2024/04/30 00:16
一、 下载ckeditor_3.6.2.zip和ckeditor-java-core-3.5.3.zip两个压缩文件,去http://ckeditor.com/官网上下载。
二、 解压缩文件ckeditor_3.6.2.zip和ckeditor-java-core-3.5.3.zip两个文件,在ckeditor_3.6.2文件中有ckeditor文件夹;ckeditor-java-core-3.5.3中有ckeditor-java-core-3.5.3.jar、 ckeditor-java-core-3.5.3-javadoc.jar和ckeditor-java-core-3.5.3-sources.jar三个jar包。
三、 我使用的是Myeclipse开发工具,新建工程,接着把ckeditor_3.6.2文件夹下的ckeditor整个复制到工程WebRoot下;然后把ckeditor-java-core-3.5.3文件夹下的三个jar包复制到WebRoot——>WEB-INF——>lib文件夹下,最后整个工程的目录如图:
注意:该版本的不需要在web.xml文件中配置<servlet></servlet >
四、 下面写一个jsp页面来使用这个ckeditor,为了省时间,直接在index.jsp页面上写代码。如图:
注意:要使用就必须先引入ckeditor.js文件
<scripttype="text/javascript"src="ckeditor/ckeditor.js"></script>
五、 接下来发布工程,启动服务器,在地址栏中输入:http://localhost:8899/ckeditor
就可以访问了。访问的效果如图:
通过上面的介绍,大家应该可以看出使用ckeditor的方便快捷。大家不需要任何的改变就可以在项目中引用在线编辑器了。
当然要想根据自己的需求进行定制就需要进行一些更深入的学习,不过也并不难。
我们可以在项目中新建一个ckconfig.js文件专门用来定制自己的ckeditor,下面贴出一个本人自己的配置
下面是简单的配置
/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rightsreserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here. Forexample:
config.language = 'zh-cn'; //配置语言
config.uiColor = '#BFEFFF'; //背景颜色
config.width = 700; //宽度
config.height = 300; //高度
config.skin='kama';
//工具栏
config.toolbar =
[
['Source','Bold','Italic'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Smiley'],
['Styles','Font','FontSize'],
['TextColor'],
['Undo','Redo']
];
};
你可以根据自己的需要定制,下面贴出一个含有完整工具栏的配置文件 ,供大家参考定制自己的工具栏
view plaincopy to clipboardprint?
/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rightsreserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config )
{
config.language = 'zh-cn';
config.width = 900;
config.height = 300;
config.skin = 'kama';
// 背景颜色
config.uiColor = '#BFEFFF';
config.toolbar_Full = [
['Source','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker','Scayt'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form', 'Checkbox', 'Radio', 'TextField','Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
'/',
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Link','Unlink','Anchor'],
['Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
'/',
['Styles','Format','Font','FontSize'],
['TextColor','BGColor']
];
};
- Ckeditor编辑器在JAVA中的使用与配置
- Ckeditor编辑器在JAVA中的使用与配置
- CKEditor编辑器使用配置
- FCKeditor编辑器在JAVA中的使用与配置
- FCKeditor编辑器在JAVA中的使用与配置
- FCKeditor编辑器在JAVA中的使用与配置
- FCKeditor编辑器在JAVA中的使用与配置
- FCKeditor编辑器在JAVA中的使用与配置方法
- FCKeditor编辑器在JAVA中的使用与配置方法
- FCKeditor编辑器在JAVA中的使用与配置
- Ckeditor编辑器的配置使用
- 在线html网页编辑器ckeditor的使用与配置
- Ckeditor使用与配置——HTML可视化编辑器
- Ueditor和CKeditor 两款编辑器的使用与配置
- 网站文本编辑器CKeditor的使用与配置
- Ueditor和CKeditor 两款编辑器的使用与配置
- Ueditor和CKeditor 两款编辑器的使用与配置
- Ueditor和CKeditor wysihtml5 编辑器的使用与配置
- 1129
- Ubuntu10.10上配置安装LAMP
- iconv 的技巧
- 第一次当审稿人
- win7下myeclipse/eclipse使用subclipse进行checkout时自动关闭问题
- Ckeditor编辑器在JAVA中的使用与配置
- 用汇编的眼光看C++(之虚函数)
- linux学习笔记(十) linux下查找文件、字符串
- res/ 资源(Resource)目录简介
- js-window属性说明
- Empty Recycle Bin by vb script - 用VB脚本清空Windows回收站
- Qt —— QVariant
- C/C++封装库ocicpplib调用Oracle存储过程的方法
- 你不得不熟悉的字符串处理函数