web.xml
index.jsp
<!-- 主页 -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<!-- 用户请求动作servlet -->
<servlet>
<servlet-name>baseAction</servlet-name>
<servlet-class>com.pspe.web.action.BaseAction</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>baseAction</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
<!-- 样式过滤器,防盗链及防下载 -->
<filter>
<filter-name>styleFilter</filter-name>
<filter-class>com.pspe.web.filter.StyleFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>styleFilter</filter-name>
<url-pattern>/js/*</url-pattern>
</filter-mapping>
index.jsp
<!-- 加随机数为了防止缓存从而盗链 -->
<script src="js/index.js?<%=new java.util.Random().nextInt(1000000)%>" type="text/javascript"></script>
<body>
<!-- login--uname-admin--upwd-123456.html -->
<a href="login--uname-admin--upwd-123456.html">click me</a>
<form action="reguser.html" method="post">
<input type="submit" value="check" />
</form>
<input type="button" onclick="show()" value="show" />
<a href="js/index.js?<%=new java.util.Random().nextInt(1000000)%>">另存</a>