Spring Boot整合UEditor不修改源码

 1.创建Springboot项目,目录结构如下(在resources中static/ueditor/jsp/config.json)

          

        2.pom文件引入

<dependency>
    <groupId>cn.jasonone.ueditor</groupId>
	<artifactId>ueditor-spring-boot-starter</artifactId>
	<version>1.1.4</version>
</dependency>

  

3. Springboot application.yml配置(可选配置)

ue:
  root-path: classpath:/static #文件存储根目录(可选配置),默认为[classpath:/static]
  server-url: /ueditor/jsp/controller #服务器统一请求接口路径(可选配置),默认为[/ueditor/jsp/controller]
  upload: cn.jasonone.ueditor.upload.LocationFileStorage #文件持久化处理类(可选配置),默认为[cn.jasonone.ueditor.upload.LocationFileStorage]

  

 4.UEditor配置(必选)

  • static/ueditor/ueditor.config.js 将serverUrl 改为application.yml 中ue.server-url 的值
//...
//服务器统一请求接口路径
, serverUrl: URL + "jsp/controller"
//...

  

 5.HTML代码(index.html)

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<script type="text/plain" id="editor"></script>
	<script th:src="@{/ueditor/ueditor.config.js}"></script>
	<script th:src="@{/ueditor/ueditor.all.js}"></script>
	<script th:src="@{/ueditor/lang/zh-cn/zh-cn.js}"></script>
	<script>
		UE.getEditor('editor');
	</script>
</body>
</html>

  


项目地址:https://gitee.com/hmjasonone/ueditor-spring-boot-stater

错误:Unable to read meta-data for class com.jason.ueditor.UeditorAutoConfiguration

 出错版本: 1.1.0

 解决办法: 将Jar包更新到1.1.3版本

  

转载于:https://www.cnblogs.com/mracale/p/11399021.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值