springmvc整合ueditor,ueditor修改上传路径及页面回显问题

1、        在官网(http://ueditor.baidu.com/website/download.html)下载ueditor完整源码

2、查看官网文档(http://fex.baidu.com/ueditor/)



3、 (https://nodejs.org/en/)下载nodejs进行安装,安装后在命令行执行node –v,出现nodejs的版本号说明安装成功

4、 进入ueditor源码根目录,执行npm install,命令执行结束后,会在ueditor目录下出现一个node_modules文件夹


5、 仍然在该目录下,执行 grunt --encode=utf8 --server= jsp 命令进行打包(电脑上需要有Java环境),

打包成功后会在ueditor源码根目录下出现dist文件夹,里面就是打好包的ueditor了


6、 创建一个web工程,导入刚才打包后的jar包


7、 复制jsp源码到工程中


8、 项目结构



下面要开始修改源码了,注意:

//======================================

这里是修改的代码

//======================================

其他的均是源码部分

9、 修改ConfigManager.java文件

找到private ConfigManager ( String rootPath, String contextPath, String uri )方法

	private ConfigManager ( String rootPath, String contextPath, String uri ) throws FileNotFoundException, IOException {
		
		rootPath = rootPath.replace( "\\", "/" );
		
		this.rootPath = rootPath;
		this.contextPath = contextPath;
		/*
		if ( contextPath.length() > 0 ) {
			this.originalPath = this.rootPath + uri.substring( contextPath.length() );
		} else {
			this.originalPath = this.rootPath + uri;
		}
		*/
		//=================================================
		//让originalPath指向WebRoot/ueditor/ueditor.config.js文件路径
		this.originalPath = this.rootPath +"ueditor"+File.separator+"ueditor.config.js";
		//=================================================
		this.initEnv();
		
	}
找到 public Map<String, Object> getConfig ( int type )方法

                conf.put( "savePath", savePath );
		conf.put( "rootPath", this.rootPath );
		//============
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值