在IDEA中使用Ueditor富文本编辑器的配置

本文详细介绍了如何在项目中集成UEditor富文本编辑器,包括下载安装包、配置文件、添加依赖及在jsp页面中使用的方法。通过具体步骤和代码示例,帮助开发者快速上手。

1.在官网下载安装包,下载完成后如下:

2.将整个ueditor文件夹copy到项目的webapp目录下:

3.在WEB-INF文件夹下创建lib目录,并将.../ueditor/jsp/lib目录下的所有jar包copy进去

4.将这些jar包添加到项目的依赖中

5.配置ueditor.config.js文件

6.在jsp页面中使用ueditor:

引入js文件

在div中嵌入富文本编辑器

    <div class="container margin-top-10">
    	<div class="col-sm-8">
    		<div class="panel panel-default">
			  <div class="panel-body">
				<form method="post" name="newBlogForm" id="newBlogForm" action="${pageContext.request.contextPath}/newBlog.blog">
				  <input type="hidden" name="n_sid" id="n_sid" value="${student.sid}">
				  <div class="form-group">
				    <label>日志标题:</label><label class="control-label error-info" style="text-align:left;">*不能为空</label>
				    <input type="text" class="form-control" id="n_title" name = "n_title">
				  </div>
				  <div class="form-group">
				    <label>日志正文:</label><label class="control-label error-info" style="text-align:left;">*不能为空</label>
				  	
				  	<!-- 加载编辑器的容器 -->
				    <script id="n_content" name="n_content" type="text/plain">${blog.content}</script>
                    
                    <!-- 实例化编辑器 -->
				    <script type="text/javascript">
				        var ue = UE.getEditor('n_content');
				    </script>
				  </div>
				  <div style="text-align: right;">
					  <button type="submit" class="btn btn-success">发表</button>
				  </div>
				</form>
			  </div>
			</div>
   		</div>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值