I'm using jTwig templates and i have the following one:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% block title %}
<title>{{ title }}</title>
{% endblock %}
<!-- Bootstrap stylesheet-->
<link rel="stylesheet" href="{{webappRoot}}/apple-store/assets/css/bootstrap.min.css">
<!-- Custom favicon -->
<link rel="shortcut icon" href="{{webappRoot}}/apple-store/assets/img/favicon.png?v=2" />
</head>
<body>
<div class="container">
{% block content %}{% endblock %}
</div>
<script src="{{webappRoot}}/apple-store/assets/js/jquery-1.11.1.min.js"></script>
<script src="{{webappRoot}}/apple-store/assets/js/bootstrap.min.js"></script>
</body>
</html>
where apple-store
is the name of my project and webappRoot
is a variable from spring i think, so the full path here will be http://localhost:8080/apple-store/assets/<some asset>
-- because webapp = http://localhost:8080
.
There is a better way to do this? maybe a kind of "variable" like webappRoot
that brings to the view the name of my project or the path http://localhost:8080/apple-store
?