For background editing, you need to use the Rich Text Editor and select the lightweight nicedit.
[Demo is provided later in this article]
Demo author is rellen110, address is http://rellen110.iteye.com/blog/472371
---------------------
1. nicedit upload in the demo uses the "Upload. jsp" file for processing. Of course, you can also change it to your own file processing.
In the nicedit. js file
"Nicuri :'Upload. jsp',"
You can specify the server that processes the upload.Program.
2. Now let's talk about the problems encountered.
Status quo: files can be successfully uploaded to the server. There are two ways to check whether the file has been successfully uploaded.
1. Open the specified project directory of Tomcat and check whether there are newly uploaded images in the upload folder.
2. Open the nicedit. js file and press Ctrl + F to findUpdateFunction, and then add two alert statements that are commented out in the figure to check whether the returned JSON has a value,
If the above method is used for testing, it is determined that the file has been correctly uploaded to the server, and the server has also sent back the address to nicedit. However, the image is still invisible in the editor.
The reason may be the path.
For example, the page on which you currently use nicedit isRoot \ A \ editpage. jsp
The path to the Tomcat server isRoot \ upload \ xxxx.jpg
The image path returned by upload. jsp isUpload \ xxxx.jpg
It can be found that the returned image path is in the root directory, and the current editing page also