In one of my servlets, I invoke RequestDispatcher.forward()
call to a static resource somewhere under WEB-INF folder:
request
.getRequestDispatcher( "/WEB-INF/some/path/image.gif" )
.forward( request, response );
Navigating to this servlet works fine under Tomcat, Jetty et al., but does not work in WebSphere 7. The error I get (both in the browser and in the server logs) is
Error 403: SRVE0190E: File not found: /WEB-INF/some/path/image.gif
Initially I assumed that WebSphere may need some specific configuration to allow internal forwarding to resources under WEB-INF, but I failed to google anything useful.
Any ideas why can this happen?
Thanks in advance!
It appears that one should set
exposeWebInfOnDispatch
property totrue
in order to make WEB-INF accessible for servlets in WebSphere. I got this answer from WebSphere forum.In WebSphere 7 administration console,
Add new property:
exposeWebInfOnDispatch
true