I'd like to include a jsp page for exemple
<ui:include src="/WEB-INF/jsp/header.jsp" />
but my header.jsp have variables and I need a controller to initialise theses variables, is there a way to call a controller and include the controller method jsp in an other jsp ?
For exemple;
<%@tag description="Overall Page template" pageEncoding="UTF-8"%>
<%@attribute name="header" fragment="true"%>
<%@attribute name="footer" fragment="true"%>
<html>
<body>
<div id="pageheader">
//include my header controller
<ui:include src="/WEB-INF/jsp/header.jsp" />
</div>
<div id="body">
<jsp:doBody />
</div>
<div id="pagefooter">
//include my footer controller
</div>
</body>
</html>
header.jsp
Header
${test}
my header method
public String header(Map<String, Object> model){
model.put("test", "test");
return "header";
}
But the controller is not used and ${test}
is empty