Commit e6c7422c by Dave Syer

Use <@spring.url/> for all relative paths in FTL

Fixes gh-125
parent 11201762
...@@ -80,18 +80,9 @@ public class EurekaController { ...@@ -80,18 +80,9 @@ public class EurekaController {
} }
protected void populateBase(HttpServletRequest request, Map<String, Object> model) { protected void populateBase(HttpServletRequest request, Map<String, Object> model) {
String contextPath = serverProperties.getContextPath(); model.put("time", new Date());
String path = (contextPath == null) ? "" : contextPath + serverProperties.getServletPath(); model.put("basePath", "/");
path = path.replace("//", "/"); model.put("dashboardPath", dashboardPath.equals("/") ? "" : dashboardPath);
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
if (!basePath.endsWith("/")) {
basePath += "/";
}
model.put("time", new Date());
model.put("basePath", basePath);
model.put("dashboardPath", dashboardPath);
populateHeader(model); populateHeader(model);
......
<#import "/spring.ftl" as spring />
<!doctype html> <!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head> <head>
<base href="${basePath}"> <base href="<@spring.url basePath/>">
<title>Eureka - Last N events</title> <title>Eureka - Last N events</title>
<link rel="stylesheet" type="text/css" href="eureka/css/wro.css"> <link rel="stylesheet" type="text/css" href="eureka/css/wro.css">
</head> </head>
......
<#import "/spring.ftl" as spring />
<!doctype html> <!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head> <head>
<base href="${basePath}"> <base href="<@spring.url basePath/>">
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Eureka</title> <title>Eureka</title>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment