Reputation: 839
I want to include a view in my .jsp page that is mapped by a spring controller. Here is the controller method:
@RequestMapping("/include/header")
public String showHeader() {
return "include/header";
}
And here is the include tag from the jsp page:
<jsp:include page="/include/header">
It works, but eclipse flags the above line with "Fragment "/include/header" was not found at expected path ..." . Is there a better way to do this that will make eclipse happy? I do want the header file to have its own controller method, otherwise I would just make it a static resource.
Upvotes: 0
Views: 814
Reputation: 1549
You are doing something the eclipse cannot know.. You have build controller that intercept url and doing something.
Eclipse is searching the file header but cannot find it because he is exist in the Controller.. So this is dynamic and cannot identified by the compilers and page validator..
Unless you won't have page with the same name you can ignore eclipse.. The warning on jsp pages are really not effective
Upvotes: 2