String tourl = request.getParameter("tourl");
url = request.getParameter("url");
          URL url1 = new URL(tourl);
                
HttpURLConnection urlConnection = (HttpURLConnection) url1.openConnection();         boolean bool = false;

if (!(urlConnection.getResponseCode() == 200)) {
bool = true;
} if (bool == true)
out.print(" <iframe src='images/error3.png' width='700px;' height='700px'>你的浏览器版本过低!请下载最新版浏览器,重新再试。 </iframe>");
else {
out.print(" <iframe src='"+ tourl+ "' width='700px;' height='700px'>你的浏览器版本过低!请下载最新版浏览器,重新再试。 </iframe>");
}
我想根据tourl的地址打开地址所对应的资源。。为什么,tourl内是英文的时候就能找到资源tourl为英文的时候找不到资源啊。各位大牛帮忙急求

解决方案 »

  1.   

    为什么,tourl内是英文的时候就能找到资源tourl为英文的时候找不到资源啊。
    这句话写错了吧?
    中文的时候找不到对吧?
    用urlencoding这个类吧中文换一种编码、
    然后用得到的新的字符串初始化url
      

  2.   

    我想根据tourl的地址打开地址所对应的资源。。为什么,tourl内是英文的时候就能找到资源tourl为英文的时候找不到资源啊。这句话啥意思啊  
    估计你是中文乱码了  试试转换下编码方式