Froala编辑器Java sdk示例不起作用 [英] Froala Editor Java sdk Examples don't work

查看:105
本文介绍了Froala编辑器Java sdk示例不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用froala java sdk中给出的示例上传图像时,该图片存储在本地存储中,但是该图片消失了,因为服务器无法访问该文件夹.

When I try to upload image with the exmaple given in the froala java sdk, the picture is stored in local storage but the picture disappear because the server have no access to the folder.

此处错误:

froala上传图片错误404

推荐答案

只需在Tomcat文件server.xml中添加新上下文,以指向服务器根目录中的文件夹images:

Just added new context in the Tomcat file server.xml to point to the folder images in the root of the server:

<Context docBase="images" path="" reloadable="true" source="your source"/>

然后在类File.class中更改了方法FileUtils.copyInputStreamToFile中的参数以将图像保存在此文件夹中.

Then in class File.class changed parameters in method FileUtils.copyInputStreamToFile to save images in this folder.

并且我应该在UploadImage.java中的Image.upload()调用之后添加Thread.sleep(5000)以显示图像,否则它将不起作用.我认为上传和获取图片的http请求GET之间存在同步问题.

And I should add a Thread.sleep(5000) after Image.upload() call in UploadImage.java to display image otherwise it didn't work. I think there is a problem with synchronization between the upload and the http request GET which get the image.

因此,我没有成功创建自己的servlet,因此在froala sdk示例中使用了它们.

So I didn't succeed to create my own servlet so I used those in froala sdk examples.

我试图在froala的javascript中找到http请求GET的生成位置,以更改http请求中的URL,但没有找到.

I tried to find where the http request GET is made in froala's javascript, to change the URL in http request but didn't find.

不明白为什么froala示例不起作用,而是找到如何使其以其他方式起作用.

Didn't understand why the froala example didn't work but find how to make it works in other way.

PS:对不起,英语错误

PS: Sorry for english mistakes

这篇关于Froala编辑器Java sdk示例不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆