1. 程式人生 > >設定JSP頁尾版權標識

設定JSP頁尾版權標識

若手動給所有頁面都設定頁尾版權,費時費力;現在有一個方法可以更便捷的設定頁尾版權標識

方法:  1.首先把頁尾版權標識放到web.xml中

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://xmlns.jcp.org/xml/ns/javaee"
	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
	id="WebApp_ID" version="3.1">	
	
	<context-param>
	  <param-name>copyright</param-name>
	  <param-value>Copyright By Thinkpet 版權所有,盜版必究</param-value>
	</context-param>
</web-app>

2.若需要用到版權標識時,再用EL表示式取出對應的引數值

<footer>
	<p style="text-align: center;">${initParam.copyright}</p>
</footer>

3.效果如下