Summernote + Spring MVC + Ajax Uploading pictures < notes >

Source: Internet
Author: User
Tags base64

Recently doing an exam system project. Where the entity answer has this demand, the answer a,b,c,d in the form of text and picture mashup, and the text is rich text.

That's probably how it's stored in the database.

Don't say much nonsense start on dry goods ....

First, import the file on the JSP page

Second, proceed, summernote initialization, here I initialize a lot of


Third, summernote the default image upload is to directly base64 the image encoding, and then placed in the IMG tag data (not very clear, presumably this) attribute, Base64 encoded after the generated data is very large, although it can be successfully uploaded, but if added to the database, There is no doubt that it accounts for memory. Our ideal scenario is that only the image path is stored in the database. So let's start with the transformation. That is, rewrite the summernote image upload method.

Four, the last part of the background, this online search can have a lot, whatever upload method you can use. I use the spring MVC upload method.

First remember to configure the configuration file in the

Then the controller:

Well, by this step the basic functionality can be achieved. Small partners can be more complete, such as the deletion of functions, etc.

Summernote + Spring MVC + Ajax Uploading pictures < notes >

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.