目錄
顯示所有環境變數
<!--#printenv -->
HTTP_USER_AGENT=curl/7.29.0 HTTP_ACCEPT=*/* LAST_MODIFIED=Tuesday, 03-Nov-2015 09:57:28 HKT DOCUMENT_URI=/ REMOTE_PORT=37482 SERVER_NAME=224.25.22.70 SERVER_SOFTWARE=Apache Tomcat/7.0.65 OpenJDK 64-Bit Server VM/20.0-b12 Linux SCRIPT_FILENAME=/srv/apache-tomcat/webapps/ROOT/index.html DATE_LOCAL=Tuesday, 03-Nov-2015 09:57:31 HKT SERVER_ADDR=224.25.22.70 SERVER_PROTOCOL=HTTP/1.1 REQUEST_METHOD=GET DOCUMENT_NAME= SERVER_PORT=8080 SCRIPT_NAME=/index.html REMOTE_ADDR=202.130.11.34 DATE_GMT=Tuesday, 03-Nov-2015 01:57:31 GMT REMOTE_HOST=202.130.101.34 HTTP_HOST=224.25.22.70:8080 QUERY_STRING= GATEWAY_INTERFACE=CGI/1.1 org.apache.catalina.ssi.SSIServlet=true REQUEST_URI=/
例如我們需要實現一個功能,test.html?後面的參數需要傳遞到頁面中。
http://www.netkiller.cn/lp/test.html?utm_source=ss&utm_medium=baidusem&utm_campaign=lpgrant
<a href="<!--#echo var="WWW_URL"-->/customer/CreateAccount.do?<!--#echo var="QUERY_STRING"-->">新建用戶</a>