I finally found a much better aproach (at least for my workflow). It consists in not informing user to reload, but avoid it.
The way I do that is by forcing browsers not to cache the *noncache.js file. This can be done by creating a filter and adding it to the app web.xml.
The following is the doFilter()
code.
if (requestURI.contains(".nocache.")) {
Date now = new Date();
HttpServletResponse httpResponse = (HttpServletResponse) response;
httpResponse.setHeader("Pragma", "no-cache");
httpResponse.setHeader("Cache-control", "no-cache, no-store, must-revalidate");
}
filterChain.doFilter(request, response);
Then, just add the filter mapping <url-pattern>/*</url-pattern>
and you got it! Transparent changes to the user :D
Hope this helps.