jsp页面中
百度 访问不到 具体进来看
IE地址栏成了
http://localhost:8080/http://www.baidu.com
请教了
你这里写错了
out.print(""+favorite.getWebName()+"");
去掉这"/"符号
修改为
out.print(""+favorite.getWebName()+"");
有[color=red]中国特色版[/color](汉化的)的IE有这个问题。比如我的IE,输入http://localhost:8080/helloworld/,自动跳到百度。
[code="html"]http://www.baidu.com">百度[/code]
检测一下JSP的源码,是不是写错了?
你发生成的页面代码粘出来分析
[code="java"]<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%> [/code]
添加这句一试
应该没问题啊,实在不行就这样写:
../www.baidu.com
不可能吧
你的href内容是不是/http://....啊
或者直接用onclick = function() { window.location="http://www.baidu.com";}来实现跳转
[b]我的意思是:这样是错误的![/b]
[code="html"]http://www.baidu.com">百度[/code]
用这个,在连接后面加上index.html,我测试可以。[code="java"]百度[/code]