The jsp page displays two-dimensional code images. The jsp page

Source: Internet
Author: User

The jsp page displays two-dimensional code images. The jsp page

Recently, a project needs to display the QR code on the front-end page. Because we have done the QR code generation before, we use the previous method: Import qrcode. jar package, and then generate an image in the background to save it. The foreground obtains the path of the image and displays it. As you can see, this process is time-consuming. If a person tests for half an hour and has hundreds of QR code images, when will the temporary QR code images generated in the background be deleted? The first option is to delete a job immediately after it is displayed on the front-end. Due to system requirements, interaction is frequent, which affects efficiency. The second option is to delete a job regularly. Both methods can solve the problem, but they are a little stubborn.

Can I encapsulate data in a QR code on the front-end? YES, the answer is so positive, because it is so cool! Click the pseudo-code to see at a glance

<Div id = "qrcode"> </div> // The div shows the QR code $ ("# qrcode "). qrcode ({text: "Do you know that EL expressions are supported in JS? It can be written between double quotes ", size: 100 });

After text, you need to generate the content of the QR code. size indicates the size. Of course, you must import two files: jquery. js and jquery. qrcode. js. The following is the content of qrcode.

Http://download.csdn.net/detail/lianruanjian/8740913

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.