I\'m using Spring MVC.
I want to include menu page (named menu.jsp) with a controller (named MenuController) to my main page. If I call http://localhost:8080/myWeb/menu.
Try using <%@ include file="menu.jsp" %>
or <jsp:include page="menu.jsp" />
By the way, no controller interferes here - this happens purely in the view.
On the other hand, if you want your controller to set some data required in the menu, then you should indeed use <c:import />
. Not however that the path there is relative to the current page. So make sure it is correct.
I just discovered today you can trigger the controller by referencing the relative Spring url in the include.
<jsp:include page="/ConrollerRequestMapping/your/method/request/mapping"/>