读取文件时,要告诉程序文件的实际路径:比如“C:/tomcat/webapps/web/velocity/velocity.properties”,不能使用相对路径。可以使用下面的方法获得web下文件的实际路径:
request.getSession().getServletContext().getRealPath("/web/velocity/velocity.properties")
request.getSession().getServletContext().getRealPath("/web/velocity/velocity.properties")
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货