ueditor与ssh整合之上传图片篇
来源:互联网 发布:css编程 编辑:程序博客网 时间:2024/06/05 16:25
1. 加入插件
<script type="text/javascript" src="scripts/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="scripts/ueditor/ueditor.all.min.js"></script>
2.创建容器
<script id="container" name="content" type="text/plain">
</script>
3.实例化容器
var ue = UE.getEditor('container',{
initialFrameHeight:600,
})
4.重写struts2的拦截器
import java.io.IOException;import javax.servlet.FilterChain;import javax.servlet.ServletException;import javax.servlet.ServletRequest;import javax.servlet.ServletResponse;import javax.servlet.http.HttpServletRequest;import org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter;public class MyStrutsFilter extends StrutsPrepareAndExecuteFilter {@Overridepublic void doFilter(ServletRequest req, ServletResponse res,FilterChain chain) throws IOException, ServletException {HttpServletRequest request = (HttpServletRequest) req;String url = request.getRequestURI(); System.out.println(url); if (url.contains("/blog/scripts/ueditor/jsp/")) { System.out.println("使用自定义过滤器"); chain.doFilter(req, res); }else{ System.out.println("使用默认过滤器"); super.doFilter(req, res, chain); } }}
5.web.xml里
将
<filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>替换成自己写的拦截器
<filter> <filter-name>struts2</filter-name> <filter-class>com.blog.until.MyStrutsFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
5.修改ueditor/ueditor.config.js文件里
window.UEDITOR_HOME_URL = "/blog/scripts/ueditor/"
6.修改ueditor/jsp/config.json文件
"imageUrlPrefix": "/blog", /*图片前缀(项目名) */
"imagePathFormat": "/img/{yyyy}{mm}{dd}/{time}{rand:6}",(图片保存地址)
阅读全文
0 0
- ueditor与ssh整合之上传图片篇
- ueditor与struts2整合之图片上传
- Ueditor上传图片,ssh和ssm框架下Ueditor整合
- ueditor整合struts2图片无法上传问题
- JAVA ueditor + OSS 上传图片整合
- dedecms整合百度编辑器(Ueditor)之上传图片加水印的办法
- 整合UEditor,SSH下
- 关于百度UEditor在ssh图片上传被拦截
- UEditor上传图片与spring mvc上传图片冲突问题。
- UEditor之——与SpringMVC整合
- UEditor之——与SpringMVC整合
- 百度UEDITOR与ASP.NET上传整合的简要教程
- ueditor项目实践--图片上传篇
- Ueditor JSP 图片上传
- UEditor上传图片错误
- uEditor独立图片上传
- ueditor图片上传配置
- UEditor图片上传
- TortoiseSVN与VisualSVN Server搭建SVN版本控制系统
- C语言中sprintf()函数的用法
- [leetcode] 394. Decode String
- JavaScript 箭头函数
- 你了解nginx location 的root和alice吗
- ueditor与ssh整合之上传图片篇
- HBase 集群监控
- MATLAB(1)——基本调试方法(Debug)
- 社交系统ThinkSNS-plus(TS+)iOS端APP V1.0.2研发播报
- 用python写网络爬虫读书笔记 第二章数据抓取
- XRecyclerView的使用下拉刷新
- 【Android】之 布局文件管理 与 包结构
- 关于listview中onItemClick点击事件失效的解决方法
- 常用标签