<textarea rows="3" style="width:400px;" id="zw" name="zw" class="easyui-validatebox" data-options="required:true,validType:'length[1,1000000]'" invalidMessage="最大长度不能超过1000000"></textarea>
//jsp页面引入
<script type="text/javascript" src="${request.contextPath}/kindeditor/kindeditor-min.js"></script>
<scriptcharset="utf-8" src="${request.contextPath}/kindeditor/lang/zh_CN.js"></script>
$(function() {
editor = KindEditor.create('textarea[name="zw"]',{//和neme 相同
allowImageUpload:true,//允许上传图片
allowFileManager:true, //允许对上传图片进行管理
uploadJson:'${request.contextPath}/kindeditor/jsp/upload_json.jsp', //上传图片的java代码添加时的路径
//fileManagerJson:'${request.contextPath}/kindeditor/jsp/file_manager_json.jsp',//编辑是加进去
items : [
'fontname','fontsize', '|','forecolor', 'hilitecolor','bold', 'italic','underline','removeformat','|', 'justifyleft','justifycenter', 'justifyright','insertorderedlist',
'insertunorderedlist','|', 'emoticons','link','|','image','insertfile'],
resizeType : 1,width:"100%",height:"200px",afterChange:function(){
this.sync();
},afterBlur:function(){
this.sync();
}});
});
//修改upload_json.jsp
String savePath = pageContext.getServletContext().getRealPath("/") + "/kindeditor/";
String saveUrl = request.getContextPath() + "/kindeditor/";
//修改file_manager_json.jsp
String rootPath = pageContext.getServletContext().getRealPath("/") + "/kindeditor/";
String rootUrl = request.getContextPath() + "/kindeditor/";
//需要一个 下载json-simple-1.1.1.jar包