方法一:
 
  <script type= "text/javascript" src= "../js/data.js" ></script>
 
方法 2
<%
String path = request.getContextPath();
String basePath = request.getScheme()+ "://" +request.getServerName()+ ":" +request.getServerPort()+path+ "/" ;
%>
<script type= "text/javascript" src= "<%=path%>/js/data.js" ></script>