The four mechanisms of abstracting within JSP today are the jsp:include tag, the <%@ include> directive, custom tag libraries, and custom tag files.
jsp:include inserts the results of executing another JSP page, so you could do:
<jsp:include "page_naviagtor.jsp"/>
<table id="results">...</table>
<jsp:include "page_navigator.jsp"/>
<%@ include> is similar to jsp:include, save that it does not actually execute the code, rather it simply stamps it in to the original JSP source and is compiled with the rest of the page.
Custom tag libraries give you (almost) the full power of JSP tags, so you can do something like:
<tag:wrap_in_page_nav>
<table id="results"> ... </table>
</tag:wrap_in_page_nav>
These require you to write custom Java code, however.
The final, and frankly, the best option for most cases, is the JSP 2.0 Tag FIle.
Tag Files are a cross between jsp:include and custom tags. They let you do something akin to the "wrap_in_page_nav" tag, but you actually create the tag use JSP markup.
So, in many cases, you can simply cut out the part you want to refactor, and paste it in to a Tag File, then simply use the tag.
page.tag
<%@tag description="put the tag description here" pageEncoding="UTF-8"%>
<%@ taglib prefix="t" tagdir="/WEB-INF/yourtags" %>
<%@attribute name="startPage" required="true"%>
<%@attribute name="endPage" required="true"%>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<tag:page_nav startPage="${startPage}" endPage="${endPage}"/>
<jsp:doBody/>
<tag:page_nav startPage="${startPage}" endPage="${endPage}"/>
</body>
</html>
page_nav.tag
<%@tag description="put the tag description here" pageEncoding="UTF-8"%>
<%@ taglib prefix="t" tagdir="/WEB-INF/yourtags" %>
<%@attribute name="startPage" required="true"%>
<%@attribute name="endPage" required="true"%>
<div>${startPage} .. ${endPage}</div>
Finally, your JSP
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib prefix="t" tagdir="/WEB-INF/yourtags" %>
<tag:page startPage="1" endPage="4">
<table> ... </table>
</tag:page>
Each of the tag files has the full power of JSP, the only limitation is that when using your own custom tag file, you can not include scriptlet code between your custom tag file tags (you can with normal JSP tags, just now tag file tags).
Tag Files are a very powerful abstraction tool for use within JSP.