0

After a lot of debugging I found that every time I include jsp files like:

<jsp:include page="header.jsp">

when I try do do a HTTP request like: /whatever/request I get the following exception:

 javax.servlet.ServletException: File &quot;/whatever/header.jsp&quot; not found

The same exception will happen if I try any path instead of /test above for instance /test/test/request or anything.

When I removed all the directives everything is fine. How do I workaround this.

1 Answers1

0

It looks for jsp relative to context path, in your example it looks for jsp stored in /whatever/header.jsp and it is not there, you should access jsp files by writing their full project's path, otherwise it will look for those jsp in the exact folder you are referring to in your url, if it shows error in folder /list/London, and you include jsp like

<jsp:include page="some.jsp"/>

Then it will look for that file in /list/London/, but if you write

<jsp:include page="/some.jsp"/>

It will look for it in your project's root, meaning under /

Dmytro Grynets
  • 923
  • 11
  • 29
  • it's not the problem. It works when I create a file index.jsp and include header.jsp there. If the level is more than two like: /whatever/test the following error appears. I suspect it's related to app engine but still investigating why - found relatively similar problems. Probably will need to add more logs to see what happens in the app engine.. – Todor Tsonkov Feb 16 '17 at 08:54
  • header.jsp shouldn't be accessed at all... I'm trying to create a web service and for instance /list/London should return all the information for London but instead it returns the error above. I suspect the problem is similar to http://stackoverflow.com/questions/7026447/why-does-jspinclude-sometimes-cause-stackoverflowerrors-on-google-app-engine?rq=1 but I'm not 100% sure... Thanks for your effort, highly appreciated! – Todor Tsonkov Feb 16 '17 at 11:25
  • Thanks a lot!! This finally resolved my issues! Spent two weeks for one symbol "/" lol – Todor Tsonkov Feb 16 '17 at 13:23
  • Edited my answer, if it solved your issue, please, consider marking it as answer so that other users could use it – Dmytro Grynets Feb 16 '17 at 13:50