Ueditor富编辑器
坑多的Ueditor富编辑器
第一步:修改serverUrl: window.BASEPATH + "notice/word"
第二部:添加依赖包
- <dependency>
- <groupId>org.apache.poi</groupId>
- <artifactId>poi</artifactId>
- <version>3.17</version>
- </dependency>
- <dependency>
- <groupId>org.apache.poi</groupId>
- <artifactId>poi-ooxml</artifactId>
- <version>3.13</version>
- </dependency>
- <dependency>
- <groupId>org.apache.poi</groupId>
- <artifactId>ooxml-schemas</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.poi</groupId>
- <artifactId>openxml4j</artifactId>
- <version>1.0-beta</version>
- </dependency>
- <dependency>
- <groupId>fr.opensagres.xdocreport</groupId>
- <artifactId>org.apache.poi.xwpf.converter.xhtml</artifactId>
- <version>1.0.6</version>
- </dependency>
- <dependency>
- <groupId>org.apache.poi</groupId>
- <artifactId>poi-scratchpad</artifactId>
- <version>3.13</version>
- </dependency>
- <dependency>
- <groupId>org.jsoup</groupId>
- <artifactId>jsoup</artifactId>
- <version>1.8.3</version>
- </dependency>
- <dependency>
- <groupId>net.sourceforge.cssparser</groupId>
- <artifactId>cssparser</artifactId>
- <version>0.9.25</version>
- </dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>1.3.3</version>
- </dependency>
- <dependency>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
- <version>20160810</version>
- </dependency>
- <!-- emf转png -->
- <dependency>
- <groupId>org.freehep</groupId>
- <artifactId>freehep-graphicsio</artifactId>
- <version>2.3</version>
- </dependency>
- <dependency>
- <groupId>org.freehep</groupId>
- <artifactId>freehep-graphicsio-emf</artifactId>
- <version>2.3</version>
- </dependency>
- <!-- wmf转svg -->
- <dependency>
- <groupId>net.arnx</groupId>
- <artifactId>wmf2svg</artifactId>
- <version>0.9.5</version>
- </dependency>
- <!-- svg转jpg --><!-- 缺少 batik-all-1.7.jar-->
- <dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis-ext</artifactId>
- <version>1.3.04</version>
- </dependency>
- <dependency>
- <groupId>com.gitee.qdbp.thirdparty</groupId>
- <artifactId>ueditor</artifactId>
- <version>1.4.3.3</version>
- </dependency>
第三部:写controller
- @RequestMapping(value = "word")
- public void word(HttpServletRequest request,HttpServletResponse response) throws Exception{
- String rootPath = request.getSession()
- .getServletContext().getRealPath("/");
- boolean isMultipart = ServletFileUpload.isMultipartContent(request);
- FileItem fileItem = null;
- if (isMultipart) {
- DiskFileItemFactory factory = new DiskFileItemFactory(1024 * 1024 * 20, null);
- ServletFileUpload uploader = new ServletFileUpload(factory);
- uploader.setHeaderEncoding("UTF-8");
- uploader.setSizeMax(1024 * 1024 * 20);
- List<FileItem> fileItems = uploader.parseRequest(request);
- for (FileItem item : fileItems) {
- if (!item.isFormField()) {
- fileItem = item;
- }
- }
- }
- try {
- String exec = new ActionEnter(request, rootPath, fileItem).exec();
- PrintWriter writer = response.getWriter();
- writer.write(exec);
- writer.flush();
- writer.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- <textarea id="container" name = "container" type="text/plain" style="width: 1200px;"></textarea>
- <!-- 配置文件 -->
- <script type="text/javascript" src="js/ueditor/ueditor.config.js"></script>
- <!-- 编辑器源码文件 -->
- <script type="text/javascript" src="js/ueditor/ueditor.all.js"></script>
- <script type="text/javascript" src="js/ueditor/lang/zh-cn/zh-cn.js"></script>
- var ue = UE.getEditor('container',{
- toolbars: [
- ['undo', 'redo','importword','print','cleardoc']
- ],
- initialFrameWidth : 690,
- });
- ue.ready(function() {
- ue.setHeight(300);
- ue.setContent('');
- })
二次加载ueditor
- UE.delEditor('container');
- var ue = UE.getEditor('container',{
- toolbars: [
- ['undo', 'redo','importword','print','cleardoc']
- ],
- initialFrameWidth : 690,
- });
- ue.ready(function() {
- ue.setHeight(300);
- ue.setContent('');
- ue.setContent(dgmcfjData);
- })
- //ueditor.all.js
- UE.plugin.register('importword', function (){
- domUtils.on(input, 'change', function(){
- me.execCommand('cleardoc');//清空内容
- //var message = document.getElementById('edui1_message_holder');
- //替换为
- var message = document.getElementById(me.ui.id + '_message_holder');
- })
- })
Ueditor富编辑器的更多相关文章
- MVC 使用 Ueditor富文本编辑器
一.Ueditor 1.下载Ueditor富文本编辑器 官方下载地址: http://ueditor.baidu.com/website/download.html 建议下载开发版,此处我下载的是 . ...
- Thinkphp下嵌套UEditor富文本WEB编辑器
UEditor是由百度web前端研发部开发所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点,开源基于MIT协议,允许自由使用和修改代码... 本文实际操作于ThinkPHP框架下,现 ...
- 百度ueditor富文本编辑器的使用
百度ueditor富文本编辑器的使用 //以下为我在官网下载的ueditor v1.3.5 php版的大楷配置步骤第一步: //配置文件的引入应该比功能文件先引入,最后设置语言类型.即:editor. ...
- 前后端分离ueditor富文本编辑器的使用-Java版本
最近在写一个自己的后台管理系统(主要是写着玩的,用来熟悉后端java的知识,目前只是会简单的写点接口),想在项目中编写一个发布新闻文章的功能,想到了使用百度的ueditor富文本编辑器,网上找了很多j ...
- ASP.NET MVC5 中百度ueditor富文本编辑器的使用
随着网站信息发布内容越来越多,越来越重视美观,富文本编辑就是不可缺少的了,众多编辑器比较后我选了百度的ueditor富文本编辑器. 百度ueditor富文本编辑器分为两种一种是完全版的ueditor, ...
- PHP如何搭建百度Ueditor富文本编辑器
本文为大家分享了PHP搭建百度Ueditor富文本编辑器的方法,供大家参考,具体内容如下 下载UEditor 官网:下载地址 将下载好的文件解压到thinkphp项目中,本文是解压到PUBLIC目录下 ...
- ueditor富文本编辑器使用百度地图自定义动态地图组件及兼容https及http协议
ueditor富文本编辑器默认支持百度地图组件,但是如果导入动态地图后会加很多默认的地图组件在上面.如果需要自定义动态地图的组件则需要修改ueditor特定的html. ueditor百度地图组件所在 ...
- WEB项目中使用UEditor(富文本编辑器)
Ueditor富文本编辑器是在很多项目里经常用到的框架,是百度开发团队开发的一款很好用的富文本编辑器 下面就是我在一个系统里用到的,有了富文本编辑器,管理员使用起来不是很方便? 所以本博客介绍这个富文 ...
- UEditor富文本编辑器简单使用
UEditor富文本编辑器简单使用 一.下载地址:https://ueditor.baidu.com/website/ 官网中并没有 python 版本的 UEditor 富文本编辑器,本文简单介绍 ...
随机推荐
- 使用JS&jQuery改善用户体验
第一章 JavaScript基本语法 一.运算符 运算符就是完成操作的一系列符号,它有七类: 赋值运算符(=,+=,-=,*=,/=,%=,<<=,>>=,|=,&= ...
- ajax的post提交方式和传统的post提交方式哪个更快?
如果同时用ajax和post提交先执行哪个呢?是ajax返回后再执行post呢还是同时执行? ajax的post提交方式和传统的post提交方式哪个更快? >> php这个答案描述的挺清楚 ...
- CREATE TABLE 语句后的 ON [PRIMARY] 起什么作用
CREATE TABLE [dbo].[table1] ( [gh] [char] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ...
- 如何使用阿里云的yum源
这里需要有网.因为我们需要下载会用到wget [root@localhost ~]# iptables -F[root@localhost ~]# systemctl stop firewalld[r ...
- SVG矢量动画
一.概述 相较于png.jpg等位图通过存储像素点来记录图像,svg (Scalable Vector Graphics)拥有一套自己的语法,通过描述的形式来记录图形.Android并不直接使用原始的 ...
- Airtest ——poco
1. Pymysql(No module named ‘cryptography’) pip install cryptography pip install paramiko 把 cryptogr ...
- 安装laravel项目出错
我的本地是7.0.1,而下载下来的原来是运行在7.0.8版本的,于是执行:composer install 时,报了一堆错.解决办法:删掉composer.lock,重新composer instal ...
- HDU 1042 N!( 高精度乘法水 )
链接:传送门 思路:高精度乘法板子题,高精度耗时又耗空间...... /**************************************************************** ...
- CF343E Pumping Stations(最小割树)
没学过最小割树的出门左转. 我们已经知道了两点的最小割就是最小割树上,对应两点之间路径的权值的最小值. 找到最小割树中权值的最小的边. 那么一定是先选完一侧的点在选完另一侧的点. 因为当前边最小,那么 ...
- C文件I/O超详细教程
本文主要参考了C Primer Plus (5th & 6th Edition) 您可以选择本文的部分内容来读,有些内容对于不熟悉MS-DOS的读者可能过于晦涩难懂. C语言文件基本知识 文件 ...