request.getServletContext().getRealPath("/") 获取项目所在服务器的全路径,如:D:\Program Files\apache-tomcat-7.0.25\webapps\TestSytem\
: C% g, s& ` s- ]request.getServletPath() 获取客户端请求的路径名,如:/object/delObject - _7 N. n, M) b+ J$ {: T0 b
request.getServerName() 获取服务器地址,如:localhost
, C' W4 K5 L/ Q. A R8 s2 hrequest.getServerPort() 获取服务器端口,如8080 ; @) W/ Z& r1 K4 I+ t: }$ X
request.getContextPath() 获取项目名称,如:TestSytem " _; \ d# f. g0 J
request.getLocalAddr() 获取本地地址,如:127.0.0.1 : W1 f8 x' R; @5 S
request.getLocalName() 获取本地IP映射名,如:localhost " Z, t# ~1 E. J7 E4 \" }
request.getLocalPort() 获取本地端口,如:8090
% @ \2 q3 u% \& e! ?1 ?, Arequest.getRealPath("/") 获取项目所在服务器的全路径,如:D:\Program Files\apache-tomcat-7.0.25\webapps\TestSytem\ + P: r1 O' }* F5 H4 i3 z5 [0 x
request.getRemoteAddr() 获取远程主机地址,如:127.0.0.1 4 t4 Y6 Q) _0 ^4 r$ J5 U+ \
request.getRemoteHost() 获取远程主机,如:127.0.0.1
* L1 q7 Z- d* W0 N- Urequest.getRemotePort() 获取远程客户端端口,如:3623 / n( {9 r, l* q* j
request.getRequestedSessionId() 获取会话session的ID,如:823A6BACAC64FB114235CBFE85A46CAA 5 A; j) o5 A9 c# Q
request.getRequestURI() 获取包含项目名称的请求路径,如:/TestSytem/object/delObject 2 P; S: { P3 l5 ]* a
request.getRequestURL().toString() 获取请求的全路径,如:http://localhost:8090/TestSytem/object/delObject
& j* I& @1 j) H4 L# Z6 a2 ~ |