Home > Java > JavaBase > body text

Java url parameters are garbled

Release: 2019-11-22 14:07:49
Original
2484 people have browsed it

Java url parameters are garbled

If the Chinese parameters of the URL are garbled, you can try:

Method 1: (java) The first page

Use when splicing URL parameters :URLEncoder.encode(parameter, "UTF-8")

The second page gets the parameter from the request

Value=new String(request.getParameter(parameter name).getBytes( "iso-8859-1"),"utf-8"); shopName = URLDecoder.decode(value, "UTF-8");

Method 2 (JavaScript)

Use directly encodeURI (Chinese)

Then you can get it directly in the background

For more java knowledge, please pay attention tojava basic tutorial.

The above is the detailed content of Java url parameters are garbled. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template