惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
T
The Blog of Author Tim Ferriss
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
A
About on SuperTechFans
Attack and Defense Labs
Attack and Defense Labs
Project Zero
Project Zero
C
Cybersecurity and Infrastructure Security Agency CISA
N
Netflix TechBlog - Medium
P
Privacy International News Feed
爱范儿
爱范儿
V
Vulnerabilities – Threatpost
The Hacker News
The Hacker News
MongoDB | Blog
MongoDB | Blog
Spread Privacy
Spread Privacy
G
Google Developers Blog
Cyberwarzone
Cyberwarzone
L
LINUX DO - 热门话题
C
Cisco Blogs
T
Tor Project blog
NISL@THU
NISL@THU
I
InfoQ
P
Privacy & Cybersecurity Law Blog
Simon Willison's Weblog
Simon Willison's Weblog
D
DataBreaches.Net
有赞技术团队
有赞技术团队
S
Schneier on Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
月光博客
月光博客
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
G
GRAHAM CLULEY
Cisco Talos Blog
Cisco Talos Blog
Recent Announcements
Recent Announcements
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Threatpost
B
Blog
Microsoft Security Blog
Microsoft Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
H
Help Net Security
美团技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Scott Helme
Scott Helme
腾讯CDC
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
The Register - Security
The Register - Security

博客园 - xwy.net

玩转ubuntu8.04,记录下碰到的问题,及解决 解决div里放table自适应的问题 temp - xwy.net - 博客园 hibernate annotation+spring 级联更新问题解决 sitemesh,html乱码问题解决不了,难道一定要用jsp - xwy.net - 博客园 注意啦,Struts 2.1.6跟sitemesh-2.4.1不兼容 struts2+freemarker+sitemesh乱码,解决了 firefox3关闭缓存的办法 jQuery.Autocomplete(新版本)自动完成插件在中文应用时的BUG修正 - xwy.net - 博客园 关于Content-Length cxfc采用UsernameToken时的PasswordDigest问题 centos5.1远程升级ssh到5.0p1 asm冲突的问题,找了半天 莫名其妙的网络问题,原来是KB951748惹得祸 RHCS环境中oracle监听的问题 解决jasperreport生成html分页和打印问题 自制百香果汁(图) svn的RA layer request failed问题 MySQL的AUTO_INCREMENT
搞定URL中文编码 - xwy.net - 博客园
xwy.net · 2008-09-22 · via 博客园 - xwy.net

原先以为这样就可以

public static String StrToURL(String str) {
        String result = null;
        try {
            result = URLEncoder.encode(str, "utf-8");// gb2312
        } catch (UnsupportedEncodingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return result;
    }

    public static String URLtoStr(String url) {
        String result = null;
        try {
            result = URLDecoder.decode(url, "utf-8");
            // 空格替换成加号
            result = result.replaceAll(" ", "+");
        } catch (UnsupportedEncodingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return result;
    }

没想到中文还是乱码,通过抓包发现传过来的东西没错,发现是tomcat的问题,加了下面的就可以了

<Connector port="8236" protocol="HTTP/1.1"  redirectPort="8443"  URIEncoding="UTF-8" />