要获得地址前半部分,如http://192.168.0.0:8080这个字符串
String path1 = ServletActionContext.getRequest().getRequestURL().toString();
http://192.168.0.0:8080/12319/callRecord/list.do
String path2 = ServletActionContext.getRequest().getRequestURI().toString();
/12319/callRecord/list.do
然后将两个string相减
String path3 = path2.replaceAll(path1, "");
此时就获得了地址的前半部分path3