jsp使用URLDecoder在超链接中传值的问题_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:11:25
Original
723 people have browsed it

使用java.net.RULDecoder对中文进行转码然后传递给servlet的时候发现,与预期结果不一样代码在这:

"><%=hotnews.getTitle() %>
Copy after login

结果在传递的时候还是中文


回复讨论(解决方案)

用js的encodeURIComponent()

在火狐和360极速浏览器里地址栏将编码自动解析了,所以会显示中文。

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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!