本文介绍了我想要从以下网址中删除& b = 128& f = norefer的模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://www.yahoo.com& b = 128& f = norefer

我要删除& b = 128& f = norefer

String finalUrl =decodedUrl.replace("&b=128&f=norefer", "");
                page.setPageUrl(finalUrl); 

我已经使用了此代码,但是我想要的代码中没有硬编码的& b = 128& f = norefer

I have used this code but I want code without hardcoded &b=128&f=norefer in code

推荐答案

您应该为此使用Java的URL对象: http://download.oracle.com/javase/1.4.2/docs/api/java/net/URL.html#getHost ()
[在其中搜索getHost()方法.]

you should be using URL object of java for this : http://download.oracle.com/javase/1.4.2/docs/api/java/net/URL.html#getHost()
[search for getHost() method in it.]

这篇关于我想要从以下网址中删除& b = 128& f = norefer的模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 18:54