去KingEditor官网去下载KingEditor文件 kingeditor网址链接: http://kindeditor.net/demo.php
下载下来解压,把文件放入java项目中
在JSP中引入KingEditor中的JS与CSS文件
<textarea id="editor_id" name="content" />
<link rel="stylesheet" href="/static/kindeditor/themes/default/default.css" />
<script charset="utf-8" src="/static/kindeditor/kindeditor-all.js"></script>
<script charset="utf-8" src="/static/kindeditor/lang/zh-CN.js"></script>
<script type="text/javascript">
KindEditor.ready(function(K) {
var editor = K.create('#editor_id', {
uploadJson : '/static/kindeditor/jsp/upload_json.jsp',
fileManagerJson : '/static/kindeditor/jsp/file_manager_json.jsp',
allowFileManager : true,
autoHeightMode : true,//自动调整编辑区的高度
afterCreate : function(){
this.loadPlugin('autoheight');//加载插件
this.sync();},
afterBlur: function(){this.sync();}
//this.sync()用来同步数据
});
});
</script>