About Java URL Pass Special symbolic parameters of the transfer code to solve

Source: Internet
Author: User

Parameter values that can be received by server request may lose the following (& symbol and subsequent ' test ') for the following URL arguments:

Java code

Http://192.168.2.108:8080/MealOrder/LoginServlet?userAccount=Test&userPwd=20&test

How to solve it? Use UTF-8 encoding can, recommend the following a Baidu page transcoding small application (choose to search out the first), of course, there are many other ways to get the code transcoding, personal preferences, casual.

Java code

Http://www.baidu.com/s?usm=2&rsv_idx=1&wd=url%E7%BC%96%E7%A0%81%E5%9C%A8%E7%BA%BF%E8%BD%AC%E6%8D%A2 &ie=utf-8&rsv_crq=7&bs=%253c

The need to encode special characters "&" for conversion, get "%26", splicing to the original URL can

Java code

Http://192.168.2.108:8080/MealOrder/LoginServlet?userAccount=Test&userPwd=20%26test

If you pass the address bar directly to the Chinese, what is it like? I don't know ...

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.