I have a complicated issue.
I save a pdf file under WEB-INF/folder/test.pdf
But now, I want to be able to download that pdf file in a JSP file. I know that files in WEB-INF are not visible by URL, but I have tried all the answers possible in this page and none work.
String pathDownload = ((ServletContext) ActionContext.getContext().get(StrutsStatics.SERVLET_CONTEXT)).getRealPath("/WEB-INF/folder/")+ "\\";
And in my JSP file I got:
<a href="<%=pathDownload%>/test.pdf" >
So, URL route is correct, but it does nothing when clicking, returning null.
I tried to write something in the file web.xml
, but nothing works.
Also tried InputStream
in the execute()
in that class who extends ActionSupport
implements SessionAware
Can anyone help with an explanation what must I do?