1.将fckeditor准许备好的文件烤贝到WebRoot目录下.
2.创建名称为input.html的HTML页面,内容略;
3.在HTML页面的<body></body>中的第一行添加如下使用插件代码,使用插件:
<script src="/lesson4/fckeditor/fckeditor.js"></script>
4.在HTML页面中写form表单,例如下:
<form name="form3" id="form3" method="post" action="/lesson4/servlet/AddContentServlet">
<input type="text" name="title">
<input type="submit" values="submit">
</form>
5.创建名称为AddContentServlet的Servlet页面,Servlet中BODY里加入获取值的代码:
out.print("主题:<br>");
out.print(request.getParameter("title")+"<br>");
out.print("内容:<br>");
out.println(request.getParameter("editor1")+"<br>");
6.在form表单中添加一段javascript插件代码,设置fckeditor,代码如下:
<script>
var editor=new FCKeditor('editor1');
editor.BasePath='/lesson4/fckeditor/';
editor.Height=200;
editor.ToolbarSet='Default';
editor.Create();
</script>
7.可在ToolbarSet中设置值为Basic,是简化版的意思,很有意思,可以试试:
<script>
var editor=new FCKeditor('editor1');
editor.BasePath='/lesson4/fckeditor/';
editor.Height=200;
editor.ToolbarSet='Basic';
editor.Create();
</script>
8.个性化设置界面:
在lesson4/WebRoot/fckeditor/fckconfig.js中自己配置.
自己起名称设置模仿Default和Basic的格式自行设置.
9.瘦身,减少垃圾文件:
删除_samples
删除_documentation
删除_upgrade
删除_whatsnew
删除_whatsnew_history
删除fckeditor.afp
删除fckeditor.asp
删除fckeditor.cfc
删除fckeditor.cfm
删除fckeditor.lasso
删除fckeditor.php
删除fckeditor.pl
删除fckeditor.py
删除fckeditor_php4.php
删除fckeditor_php5.php
删除fckutils.cfm
删除license.txt
删除editor/_source
删除editor/plugins
删除editor/lang/ 留en.js和zh.js和zh-cn.js三个文件,其它都删掉!
删除editor/skins/office2003
删除editor/skins/silver