String realpath = ServletActionContext.getServletContext().getRealPath("/");
我用这句话获取服务器地址,一直报空指针是怎么回事
------解决方案--------------------
使用
Thread.currentThread().getContextClassLoader().getResource("/").getPath()吧
参考 代码中获取classpath
------解决方案--------------------
这个我倒是研究过,你在rospone的返回类型里面设置文件类型为application/x-download