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/

猜你喜欢

转载自www.cnblogs.com/znsongshu/p/10157249.html