request.getSession().getServletContext().getRealPath(“”) ;
在括号内不写斜线,是为了保证在Windows和liunx中同时适用。
输出:
Windows:D:/apache-tomcat-9.0.0/webapps/ROOT
liunx:/usr/tomcat/apache-tomcat-9.0.12
版权声明:本文为m0_59092234原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。
request.getSession().getServletContext().getRealPath(“”) ;
在括号内不写斜线,是为了保证在Windows和liunx中同时适用。
输出:
Windows:D:/apache-tomcat-9.0.0/webapps/ROOT
liunx:/usr/tomcat/apache-tomcat-9.0.12