HttpServletRequest 常用返回值類型

請求地址:http://localhost:8888/phoenix/attach/add

System.out.println("1 "+req.getLocalAddr());
System.out.println("2 "+req.getLocalName());
System.out.println("3 "+req.getLocalPort());
System.out.println("4 "+req.getPathInfo());
System.out.println("5 "+req.getPathTranslated());
System.out.println("6 "+req.getServerName());
System.out.println("7 "+req.getServerPort());
System.out.println("8 "+req.getServletPath());
System.out.println("9 "+req.getRequestURL());


輸出:

1 0:0:0:0:0:0:0:1
2 [0:0:0:0:0:0:0:1]
3 8888
4 null
5 null
6 localhost
7 8888
8 /attach/add
9 http://localhost:8888/phoenix/attach/add

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章