1. 程式人生 > >教務系統維護日誌(2)---學習筆記

教務系統維護日誌(2)---學習筆記

ati basepath clas color nbsp logs gets 學習 pan

1.

1 <%
2 String path = request.getContextPath();
3 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
4 String templatePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/application/template/thems/base/";
5 %>

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+request.getServerPort()+path+"/";

復習一下request 的常用方法:

request.getSchema()可以返回當前頁面使用的協議,http 或是 https;

request.getServerName()可以返回當前頁面所在的服務器的名字;

request.getServerPort()可以返回當前頁面所在的服務器使用的端口,就是80;

request.getContextPath()可以返回當前頁面所在的應用的名字;

教務系統維護日誌(2)---學習筆記