假如一個請求為 http://localhost:8080/pro/test
request.getServerName() 能得到其中的 localhost
request.getServerPort() 能得到其中的 8080
request.getRequestURL() 能得到其中的 /pro/test (就是請求的項目名+請求路徑)
request.getServletContext().getContextPath() 能得到其中的 /pro (也就是項目名)
request.getServletPath() 能得到其中的 /test (請求路徑)