JS Front end, Java background encoding decoding

Source: Internet
Author: User

Because of the security of the information transmission on the network and the Chinese transmission problem, we need to solve the JS front-end encoding and decoding of the information, the same needs to be in Java acquired JavaScript decoding results of the anti-operation-decoding code.

JS front-end Encoding---"Java decoding , as follows:

PS: When passing a parameter value as a link (such as: http://baidu.com?name=), you need to encode the URL as a parameter, you need to use the encodeURIComponent function encodeURIComponent (URL), this encoding situation in the background of the decoding method and encodeURI corresponding background decoding the same way. In this way, the illusion of not a URL is created, and the network transport is more secure

java encoding---"JS front-end decoding , as follows:

Limitations: This method can better deal with Chinese coding, decoding problems, can prevent Chinese transmission on the network is eavesdropping, but can not encode and decode the English alphabet, follow-up discussion

Reference links 1:http://tech.sina.com.cn/s/2008-07-07/1053722241.shtml about Urldecoder and Urlencoder classes in Java

Reference link 2:http://www.jb51.net/article/41157.htm about JS encoding and decoding method

JS Front end, Java background encoding decoding

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.