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 {
}
protected void populateBase(HttpServletRequest request, Map<String, Object> model) {
String contextPath = serverProperties.getContextPath();
String path = (contextPath == null) ? "" : contextPath + serverProperties.getServletPath();
path = path.replace("//", "/");
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);
model.put("time", new Date());
model.put("basePath", "/");
model.put("dashboardPath", dashboardPath.equals("/") ? "" : dashboardPath);
populateHeader(model);
......
<#import "/spring.ftl" as spring />
<!doctype html>
<!--[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 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<base href="${basePath}">
<base href="<@spring.url basePath/>">
<title>Eureka - Last N events</title>
<link rel="stylesheet" type="text/css" href="eureka/css/wro.css">
</head>
......
<#import "/spring.ftl" as spring />
<!doctype html>
<!--[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 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<base href="${basePath}">
<base href="<@spring.url basePath/>">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<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