Skip to content Skip to sidebar Skip to footer

Include Jsp On Menu Item Click

I have a main JSP page with the header and the footer, while the content of the pages is located in another JSP pages. I want to click on the menu item and load linked page via <

Solution 1:

I resolved with request object in this way:

In the JSP page:

<header><ul><li><ahref="?page=home">index</a></li><li><ahref="?page=search">search</a></li></ul>

<%if(request.getParameter("page").equals("home")){%>
    <jsp:include page="index.jsp">
 <%}else %>
    <jsp:include page="search.jsp">

That's it!

Post a Comment for "Include Jsp On Menu Item Click"