U-editor文件上传

                                                  U-editor文件上传

使用目的:利用u-editor插件对文本进行编辑

用途举例;qq留言板,此博客的编辑也用到类似编辑器

操作步骤(1)工程右键-->other中的GBK换位UTF-8

       (2)工程下metaInf建一个文件夹,命名为ueditor全小写

      3)解压下载好的压缩包,所有文件都放在ueditor中(ueditor_releaseueditor1_4_3_1-utf8-jsp中utf-8中所有文件)

               (4)将ueditor_releaseueditor1_4_3_1-utf8-jsp中jsp中所有包拷贝到web-inf中的Lib中

      (5)在引入文本编辑器的jsp页中加入

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<% String path=getServletContext().getContextPath();%>

<!--配置文件-->
<script type="text/javascript" src="<%=path %>/ueditor/ueditor.config.js"></script>

<!--编辑器源码文件-->
<script type="text/javascript" src="<%=path %>/ueditor/ueditor.config.js"></script>

</head>
<body>
<textarea id="container" name="container" style="width:800px;height:400px;margin:0auto;"></textarea>
</body>
</html>

(5)在Webcontent--jsp--lib--config中"imageUrlPreFix":"/工程名/"/*图片访问路径前缀*/

 

------------------------------------------------------------------end----------------------------------------------------------------------------------

                                                                            

 

posted @ 2017-03-04 23:53  luojuye  阅读(326)  评论(0)    收藏  举报