I'm making a Spring MVC web project and I have to have a constant header.
My basic requirement is "We would like to have a header across all screens to show who is logged in to ProjectA."
I've looked at the difference between jsp:include or %@include from here "What is the difference between <jsp:include page = ... > and <%@ include file = ... >?" but then I have also come across tiles as per this example "http://viralpatel.net/blogs/spring-3-mvc-tiles-plugin-tutorial-example-eclipse/"
My question is...what is your opinion on which is the better way to implement this.
side note: I am use to master pages in asp.net and cant seem to find something similar in Java / Spring.
You use @include
when you need to include static contents in your page i.e., contents that don't change at run-time. When you need dynamic behavior, like the way you've mentioned above, you will probably need jsp:include
, as your included part will vary based on who is logged in to which project.
You can take a look at this answer for more clarification if need be.