Spring MVC Get file under WEB-INF without a request

后端 未结 7 814
暗喜
暗喜 2020-12-24 07:08

I am trying to get hold of a file ( or a directory ) under /WEB-INF/.../

outside of a request. I need it in a bean loaded at server startup.

A

相关标签:
7条回答
  • 2020-12-24 07:46
    request.getSession().getServletContext().getResourceAsStream("yourfile.pdf");
    
    0 讨论(0)
提交回复
热议问题