Skip to content

Instantly share code, notes, and snippets.

@nickfun
Last active August 29, 2015 14:13
Show Gist options
  • Save nickfun/44fc677a8dcc96676937 to your computer and use it in GitHub Desktop.
Save nickfun/44fc677a8dcc96676937 to your computer and use it in GitHub Desktop.
// for dropwizard 0.7
import io.dropwizard.views.View;
public class BaseView extends View {
protected static final int nocache;
static {
nocache = (int) (new Date().getTime() / 1000);
}
public BaseView(String filename) {
super(filename);
}
public int getNocache() {
return nocache;
}
}
<#macro nocache>${nocache?c}</#macro>
<html>
<head>
<script src="/js/app.js?nocache=<@nocache/>"></script>
</head>
<body>
<h1>Hello</h1>
<p>Webpage!</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment