I am starting to build web applications in Spring 3 (and in J2EE) in general. Looking at the loopback example, I saw that the programmer creates many parts of the JSP, for example, the header, includes a footer, and then stitches them together using static inclusion. Anyway, I would like to be able to have a base page like Base.jsp and be able to include things like this:
<body> <jsp:include page="${subpage}"></jsp:include> </body>
the reason is that I need the main page, and then the ability to insert the ModelAndView returned by the controller, which parts of the pages are displayed in each situation (with data attached to it). This works, but does not give errors if ${subpage} not found, the jsp name is incorrect or missing. I would like more error checking ...
Is this the best and recommended way to do this? And if that seems like a good idea for what I mean, what is the right way to do this?
java spring spring-mvc jsp
gotch4
source share