Froala Editor Java sdk Examples don't work

て烟熏妆下的殇ゞ 提交于 2019-12-13 07:05:36

问题


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.

Error here:

froala upload image error 404


回答1:


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"/>

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

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.

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

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.

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

PS: Sorry for english mistakes



来源:https://stackoverflow.com/questions/42899071/froala-editor-java-sdk-examples-dont-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!