Never put static files in WEB-INF folder and never be over confident about ur analysis ;)
It could be weird but when you code in hurry to get over ASAP, it invites even more delay and trouble -I spend almost 2 hrs trying to access static files placed in a folder inside WEB-INF folder, forgetting that it will never be accessible from a browser because that’s why there exist a WEB-INF folder -to restrict public access!
So my intent was good – I had a JSP which has embedded SWF file. Everything was in root foler parellal to WEB-INF. Then I though lets restrict access to SWF using direct URL (SWF have some login code as well) – So I created a folder view “inside” WEB-INF and moved all my files there. hmm..
- After execution of business logic, I forwarded the request to JSP .
- JSP was rendered but SWF was not loaded.
- I tried redirect by putting the folders outside WEB-INF (For redirect it has to be out side WEB-INF!) and it worked!!!
- Oh my –I concluded, it’s issue with the forward, completely ignoring the fact that it’s about static file location
- After 2-3 hrs, yeah, 2-3 hrs, I used Firebug -I do not know why I did not used at the beginning, may be I was trying to be over smart and highly confident about my analysis of the cause!
- Firebug reveled that all files need to be at a place accessible by browser -which is outside WEB-INF
More than any technical learning – do not be overconfident about your analysis 😉