1.导入下载的文件
2.导入需要的jar包
3.修改imageUp.jsp中
String propertiesPath = request.getRealPath("/ueditor/jsp/config.properties");
4.修改ueditor.config.js中
(新版本不用改也可以)
var URL;
URL= "/ueditor/";
5.在引用的网页中
头文件中:
<script type="text/javascript" charset="utf-8" src="<%=path%>/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="<%=path%>/ueditor/ueditor.all.js"></script>
<link rel="stylesheet" type="text/css" href="<%=path%>/ueditor/themes/default/css/ueditor.css" />
内容中:
<textarea name="content" id="editor" style="width:700px;height:500px;">${cont }</textarea>
<script type="text/javascript">
var editor = UE.getEditor('editor');
</script>
6.struts2 jsp ueditor 上传图片失败,获取不到值,解决方法
struts封装了request。
所以这里要让struts过滤掉这个jsp页面的部分信息。
在struts.xml加入(也我的ueditor文件夹在ueditor里面,所以直接过滤了这个整个文件夹)
<constant name="struts.action.excludePattern" value="/ueditor/.*" />