JSP 파일 캐시 방지

JSP파일에서 javascript 파일을 호출할때 cache 파일을 읽지 않고 수정된 js파일을 읽기 위한 방법. 읽을 파일의 파라메터에 시스템 시간을 붙이면 항상 새로운 sample.js 파일을 읽는다.

<!-- jsp -->
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="rand" value="<%=System.nanoTime()%>" />

<script type="text/javascript" src="/js/sample.js?${rand}"></script>