Summernote + Spring MVC + Ajax Uploading pictures < notes >

Source: Internet
Author: User

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

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: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.