1. 程式人生 > >java專案地址和伺服器地址區分

java專案地址和伺服器地址區分

專案地址
String filePath = request.getSession().getServletContext().getRealPath("/") + "upload/" F:\Project\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\monkey\upload/

 

伺服器地址 
String projectServerPath = request.getScheme() + "://"+request.getServerName()+":" + request.getServerPort()
+ request.getContextPath() + "/upload/"; http://localhost:8080/monkey/upload/