Javaweb base Urlencoder.encode URL encoding of strings

Source: Internet
Author: User

Li Wu:
Learn to think more, honouring teachers save Thanksgiving. Leaf See Root 321, rivers with one.
Meekness Conscience Lord, willing to do without regrets to the most bitter. Reading exercise strong body and mind, Prudential advised and the line and cherish.



Javaee:7
javase:1.8
jstl:1.2.2
Server:tomcat 8.5
Explorer:chrome
Os:windows7 x64
Ide:myeclipse



View the string in the browser with the corresponding URL encoding (the character set of the page is UTF-8)

Code

Package Jizuiku.test;import Java.io.unsupportedencodingexception;import java.net.urlencoder;/** * URLEncoder.encode  URL encoding of a string *  * @author to the bitter * @version V17.10.27 */public class Urlencoderdemo {public static void main (string[] args) Throws Unsupportedencodingexception {String result = Urlencoder.encode ("To most bitter", "utf-8"); SYSTEM.OUT.PRINTLN (result);}}


Results

With the same coding results in the browser, the code succeeds!



Learning resources: Itcast and Itheima Video library. If you have public resources, can share to me, with your resources to learn also can.
Blog post is to watch the video, into thinking written. It's good that the teacher speaks well. Blog bad, is to give the most bitter not serious.

Javaweb base Urlencoder.encode URL encoding of strings

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.