html - Include JSP on menu item click -
i have main jsp page header , footer, while content of pages located in jsp pages. want click on menu item , load linked page via
<jsp:include page="page.jsp">
what do:
this index.jsp:
<header> <ul> <li><a href="index.jsp">index</a></li> <li><a href="page.jsp">page</a></li> </ul> </header> /*dynamic content*/ <footer></footer>
if click on second link want include page.jsp contains code central part of page
i resolved request object in way:
in jsp page:
<header> <ul> <li><a href="?page=home">index</a></li> <li><a href="?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!
Comments
Post a Comment