如何强制href方向到外部主页?

时间:2015-05-30 16:49:49

标签: html url href

我有这个HTML:

<a href="http:/myhost.com/tiles/internal?lineGeom=(-71.1208,42.3317,-71.1052,42.3261,-71.0872,42.3354,-71.0570,42.3295,-71.0376,42.3394),(-71.1208,42.3317,-71.0754,42.3311,-71.0617,42.3428,-71.0376,42.3394),(-71.1208,42.3317,-71.0675,42.3525,-71.0376,42.3395)">live map</a>

我在浏览器中打开它,如下所示:

http://localhost:63342/RoutingRegression/html_pages/delta_to_baseline_table/delta_to_baseline_samples_agg_fresh.html#astar_improve

当我按下链接时,我直接指向:

http://localhost:63342/myhost.com/tiles/internal?lineGeom=(-71.1208,42.3317,-71.1052,42.3261,-71.0872,42.3354,-71.0570,42.3295,-71.0376,42.3394),(-71.1208,42.3317,-71.0754,42.3311,-71.0617,42.3428,-71.0376,42.3394),(-71.1208,42.3317,-71.0675,42.3525,-71.0376,42.3395)

如何更改它以指向:(新的http页面):

"http:/myhost.com/tiles/internal?lineGeom=(-71.1208,42.3317,-71.1052,42.3261,-71.0872,42.3354,-71.0570,42.3295,-71.0376,42.3394),(-71.1208,42.3317,-71.0754,42.3311,-71.0617,42.3428,-71.0376,42.3394),(-71.1208,42.3317,-71.0675,42.3525,-71.0376,42.3395)"

更新

它是如何生成“http:/”而不是“http://”?

这是我的网址构建器:

    UriBuilder builder = UriBuilder
            .fromPath(Constants.LIVEMAP_BASE_URL_US)
            .scheme("http");
    return builder.build().toString();

2 个答案:

答案 0 :(得分:3)

您的网址似乎不正确

变化

http:/myhost.com

http://myhost.com

答案 1 :(得分:0)

你需要在你的网址中添加双重//:

http://myhost.com/tiles/internal?lineGeom=(-71.1208,42.3317,-71.1052,42.3261,-71.0872,42.3354,-71.0570,42.3295,-71.0376,42.3394),(-71.1208,42.3317,-71.0754,42.3311,-71.0617,42.3428,-71.0376,42.3394),(-71.1208,42.3317,-71.0675,42.3525,-71.0376,42.3395)