1.首先,想在项目中引入相关的jar包

2.html页面中加入相关的引用

<!-- kindeditor -->
<script type="text/javascript"
th:src="@{/lib/kindeditor/kindeditor.js}"></script>
<script type="text/javascript"
th:src="@{/lib/kindeditor/lang/zh_CN.js}"></script>
<th>公告内容:</th>
<td>
<textarea id="detail" name="detail" style="width:100%;height:200px;">
</textarea>
</td>

3.js文件中的方法的处理

//介绍富文本编辑器
KindEditor.ready(function(K) {
introEditor = K.create("#detail", {
width : 100,
minHeight : '300px',
uploadJson : parent.baseUrl + "file/kindeditorUploadImg",
items : [ 'source', '|', 'undo', 'redo', '|', 'preview', 'print',
'template', 'code', 'cut', 'copy', 'paste', 'plainpaste',
'wordpaste', '|', 'justifyleft', 'justifycenter',
'justifyright', 'justifyfull', 'insertorderedlist',
'insertunorderedlist', 'indent', 'outdent', 'subscript',
'superscript', 'clearhtml', 'quickformat', 'selectall',
'|', 'formatblock', 'fontname', 'fontsize', '|',
'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'strikethrough', 'lineheight', 'removeformat', '|',
'image', 'flash', 'media', 'insertfile', 'table', 'hr',
'pagebreak', 'anchor', 'link', 'unlink', '|', 'about',
'fullscreen' ],
});
});

4.富文本编辑器的赋值

introEditor.html(),
detail : introEditor.html(redner.detail)

5.富文本编辑器上传图片方法的控制器的具体实现

@RequestMapping(value = "/kindeditorUploadImg")
@ResponseBody
public editorDto imageUeditorStorage(@ModelAttribute("kindUpload") @Valid KindUpload kindUpload)
throws IOException {
editorDto dto = new editorDto();
MultipartFile file = kindUpload.getImgFile();
if (!file.isEmpty()) {
       //将上传文件的后缀名进行小写处理
String ext = StorageUtility.getFileExt(file.getOriginalFilename());        //创建新的文件的名称
String newFileName = System.currentTimeMillis() + ext;        //
File storageFile = storageUtility.getNewStorageFile(newFileName, ""); String OriginalFilename = file.getOriginalFilename();
FileCopyUtils.copy(file.getInputStream(), new FileOutputStream(storageFile)); long fileId = AttachmentFileService.createFile(newFileName, OriginalFilename, storageFile.getPath(), "test",
1);
dto.setUrl(storageUtility.getFileViewPath(String.valueOf(fileId)));
}
dto.setError(0);
return dto;
}

easyui 后台系统引入富文本编辑器的使用的更多相关文章

  1. 在后台管理系统中引入富文本编辑器 (vue-quill-editor)

    在admin系统中引入富文本编辑器 (vue-quill-editor) 由于公司项目的需求,内容需要更新,那么自然需要admin后台来上传内容,在苦苦寻觅了N个编辑器之后,终于找到了一个比较容易使用 ...

  2. bbs项目引入富文本编辑器和处理xss攻击和文章预览

    一.富文本编辑上传文章和图片 富文本编辑器我们使用kindeditor,我们首先去官网下载,然后解压,放到我们的static的目录中 然后我们在html中这样使用富文本编辑器 <!DOCTYPE ...

  3. 搭建自己的博客(十三):为博客后台添加ckeditor富文本编辑器

    使用django默认的编辑器感觉功能太少了,所以集成一下富文本编辑器. 1.安装和使用 (1).安装 pip install django-ckeditor (2).注册应用 在django的sett ...

  4. Django Admin后台使用tinymc 富文本编辑器

    1.CDN地址 <script src="//cdn.tinymce.com/4/tinymce.min.js"></script> 2.修改base.ht ...

  5. django的admin或者应用中使用KindEditor富文本编辑器

    由于django后台管理没有富文本编辑器,看着好丑,展示出来的页面不美观,无法做到所见即所得的编辑方式,所以我们需要引入第三方富文本编辑器. 之前找了好多文档已经博客才把这个功能做出来,有些博客虽然写 ...

  6. 关于layui富文本编辑器和form表单提交的问题

    今天下午因为要做一个富文本编辑器上传文件给后台,所以看了一下layui的富文本编辑器,折腾了半天,终于把这玩意搞定了. 首先需要先创建layui的富文本编辑器 <textarea id=&quo ...

  7. CKEditor富文本编辑器

    CKEditor 富文本即具备丰富样式格式的文本.在运营后台,运营人员需要录入课程的相关描述,可以是包含了HTML语法格式的字符串.为了快速简单的让用户能够在页面中编辑带格式的文本,我们引入富文本编辑 ...

  8. JAVA 集成 Ueditor 百度富文本编辑器

    开发环境:一个简单的SpringMVC框架中,用百度富文本编辑器 ueditor 实现图片和文件的上传 官网地址:http://ueditor.baidu.com/website/ 需要使用到的2个文 ...

  9. MVC 使用 Ueditor富文本编辑器

    一.Ueditor 1.下载Ueditor富文本编辑器 官方下载地址: http://ueditor.baidu.com/website/download.html 建议下载开发版,此处我下载的是 . ...

随机推荐

  1. rabbitmq源码安装及配置文件管理

    rabbitmq 源码安装 官网地址:rabbitmq http://www.rabbitmq.com/releases/rabbitmq-server/ 官网地址:erlang http://erl ...

  2. redis之(二十)redis的总结一

    1 什么是Redis Redis(REmote DIctionary Server,远程数据字典服务器)是开源的内存数据库,常用作缓存或者消息队列. Redis的特点: Redis存在于内存,使用硬盘 ...

  3. Go语言标准库之log包

    用来作日志log输出的, 比较易懂. 今天周六啊,在公司加班学习一下呀. package main import ( "log" ) func init() { log.SetPr ...

  4. 编译python可以调用的dll

    如果经过stdcall声明的方法,如果不是用def文件声明的导出函数或者extern “C” 声明的话,编译器会对函数名进行修改;在编译加上extern C:这样就OK了:另外可以在PYTHON代码里 ...

  5. Nodejs Mocha测试学习

    参考大神阮一峰的文章<测试框架 Mocha 实例教程> 目前在使用Nodejs,但写完的程序很容易出错,那怎么办?需要引入单元测试去做基础的测试 目前Nodejs用来做单元测试的工具接触的 ...

  6. Eclipse Qt开发环境的建立

    1.下载Eclipse目前Eclipse+CDT已经可以集成下载了,好像优化过了,速度还比较快.下载的地址是:http://www.eclipse.org/downloads/,选择“Eclipse ...

  7. 洛谷P2590 [ZJOI2008] 树的统计 [树链剖分]

    题目传送门 树的统计 题目描述 一棵树上有n个节点,编号分别为1到n,每个节点都有一个权值w. 我们将以下面的形式来要求你对这棵树完成一些操作: I. CHANGE u t : 把结点u的权值改为t ...

  8. 在Eclipse调试Weblogic上的web项目

    概述 参考原文:weblogic debug配置. weblogic版本:BEA WebLogic Platform 8.1 工作原理: 利用java tools里面的jdb程序连接远程的JAVA虚拟 ...

  9. AutoHotKey 常用脚本

    ; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a ; semicolon, such as this one, are c ...

  10. NetCore2.0 RozarPage自动生成增删改查

    原文链接:https://docs.microsoft.com/zh-cn/aspnet/core/tutorials/web-api-help-pages-using-swagger 上面的只是原文 ...