Jsf 2.0 search and paging like this site has

In jsf 2.0, where is there just one example of a yahoo or google or even sitepoint.com like example where you can:

   1. Have a search page where user types in a search criteria.
   2. Hit a link or command button.
   3. Have a paged resultset come up.

I have not seen one example of this using only j2ee 6 technology. No third party products like icefaces, richfaces, primefaces, tomahawk, or whatever. Just beans and the xhtml pages. Of course efficient paging where there are possibly tens of thousands of records.
In jsp/ servlets I can easily accomplish this:

enter code here
    <%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head>
<title>Data Page</title>
<script type="text/javascript" src="include/jquery.js"></script>
<script type="text/javascript" src="include/myjq.js"></script>

</head>
<body>
<table id="myTable" border="1" width="303">
<tr>
<td width="119"><b>ID</b></td>
<td width="168"><b>Message</b></td>
</tr>

<c:forEach items="${data}" var="item">
<tr onMouseover="this.style.backgroundColor='lightgreen'" onMouseout="this.style.backgroundColor='#ffffff'">
<td width="100">${item.petid}</td>
<td width="168">${item.petname}</td>

</tr>
</c:forEach>
</table>
<c:set var="pageno" value="${page}" />
<c:if test="${pageno > 1}">
    <a href="plist?t1=${t1}&page=${pageno-1}">  [ prev ]  </a>
</c:if>
<c:if test="${pageno < cpage}">
    <a href="plist?t1=${t1}&page=${pageno+1}">  [ next ]  </a>
</c:if>


</body>
</html>

servlet: (a modified example)

    import java.io.*;
//import java.util.Enumeration;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.lang.String.*;
//import javax.servlet.jsp.*;
//import java.net.*;
//<%@ include file = "include/util.inc" %>

import java.util.ArrayList;
import java.util.HashMap;
//import java.util.List;
import java.util.Map;


public class plist extends HttpServlet{
     private ServletConfig config;

  //Setting JSP page

  //String page="DataPage.jsp";
  String topage="index2.jsp";
  Connection theConnection;


    @Override
  public void init(ServletConfig config)

  throws ServletException{

 this.config=config;

 }

    @Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException,IOException
{
//String topage="index2.jsp";
   HttpSession session = request.getSession(true);

   response.setContentType("text/html");

   PrintWriter out = response.getWriter();

SQLBean.DbBean db = new SQLBean.DbBean();

    out.println("<script language=\\"text/javascript\\" src=\\"include/jquery.js\\"></script>");
    out.println("<script language=\\"text/javascript\\" src=\\"include/myjq.js\\"></script>");
ArrayList dataList = new ArrayList();
try{


     //Loading Sun's JDBC ODBC Driver
    // Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
     Class.forName("com.mysql.jdbc.Driver");

   //Connect to emaildb Data source
   //theConnection = DriverManager.getConnection("jdbc:odbc:emaildb", "admin", "");
   theConnection = DriverManager.getConnection("jdbc:mysql:///petback2", "root", "sa");

String t1;

t1 = request.getParameter("t1");

String page;
int rowsperpage = 5;
int pageno = 0;
int offset = 0;



page = request.getParameter("page");
if (page == null)
{
offset = 0;
pageno = 1;
}
else
{
pageno = Integer.parseInt((String)page);
offset = 5 * (pageno - 1);
// out.println(cpage + "<br>");

// out.println("varpt = " + varpt);
}



//pageno = Integer.parseInt((String)page);
//offset = 5 * (pageno - 1);
//p1 = req.getParameter("p1");


String query = "";
query = "SELECT count(petid) FROM pets WHERE petname like ?";
//Statement cs=theConnection.createStatement();
   //ResultSet rc=cs.executeQuery(query);
PreparedStatement cs  = theConnection.prepareStatement(query);
    cs.setString(1, t1 + "%");
    //cs.setString(1, t1 + "%");
    ResultSet rc = cs.executeQuery();

int rowcount;
rowcount = 0;
while (rc.next())
{
rowcount = rc.getInt(1);
}
int cPage;
int rcount;
rcount = rowcount;
cPage = (rcount / 5);
if (rcount < 6)
    {
    cPage = 1;
    }
else
    {
        if ((cPage * 5) == rcount)
            {
            cPage = cPage * 5;
            }
        else
            {
            cPage = (cPage) + 1;
            }
    }

String t11;
t11 = db.convJS(t1);
//out.println(t11);
query = "select * from pets WHERE petname like '" +  t11 + "%" + "' ORDER BY petname LIMIT "+ offset + ", " + rowsperpage;
// query = "select * from powners WHERE oname like '" +  t11 + "%" + "' ORDER BY oname LIMIT "+ offset +",5";
Statement theStatement=theConnection.createStatement();
   ResultSet rs=theStatement.executeQuery(query); //Select all records from emaillists table.

  //Fetch all the records and print in table
//int kount;
//String rowid;


//kount = 0;
while (rs.next())
{
//kount = kount + 1;
Map author1 = new HashMap();
  author1.put("petid", rs.getString(1));
  author1.put("petname", rs.getString(2));
  dataList.add(author1);

//rowid = "a" + rs.getString(1);

//if (rs.getString(3) != null && rs.getString(3).length() > 0)
//    {
//    out.println("<td>" + rs.getString(3) + "</td>");
//    }
//else
//    {
//    out.println("<td>" + "&nbsp;" + "</td>");
//    }

// '<td>'.'<a href="JavaScript:"onclick="">'.$rowid.'</a>'.'</td>'.

//out.println("<td><a href=\\"JavaScript:\\" onclick=\\"\\">" + rowid + "</a></td>");
//out.println("</tr>");
}

int tpage = 0;
tpage = pageno + 1;

  rs.close();//Close the result set

  theStatement.close();//Close statement

  theConnection.close(); //Close database Connection
    //req.setAttribute("data",dataList);
    //RequestDispatcher dispatcher = req.getRequestDispatcher(topage);
    //if (dispatcher != null){
    //dispatcher.forward(req, res);
    //}
request.setAttribute("data",dataList);
request.setAttribute("page",page);
request.setAttribute("t1",t1);
request.setAttribute("cpage",cPage);
    RequestDispatcher dispatcher = request.getRequestDispatcher(topage);
    if (dispatcher != null){
    dispatcher.forward(request, response);
    }


}catch(Exception e){

   out.println(e.getMessage());//Print trapped error.

  }




 }
}

Bean frangment for escaping strings:

public String convJS(Object s) {
// Convert problem characters to JavaScript Escaped values
  if (s == null) {
    return "";
  }
//String t;
  String t = (String)s;
  t = replace(t,"\\\\","\\\\\\\\"); // replace backslash with \\\\
  t = replace(t,"'","\\\\\\'");  // replace an single quote with \\'
  t = replace(t,"\\"","\\\\\\""); // replace a double quote with \\"
  t = replace(t,"\\r","\\\\r"); // replace CR with \\r;
  t = replace(t,"\
","\\\
"); // replace LF with \
;

  return t;
}

public String replace(String s, String one, String another) {
// In a string replace one substring with another
  if (s.equals("")) return "";
  String resfix = "";
  int i = s.indexOf(one,0);
  int lastpos = 0;
  while (i != -1) {
    resfix += s.substring(lastpos,i) + another;
    lastpos = i + one.length();
    i = s.indexOf(one,lastpos);
  }
  resfix += s.substring(lastpos);  // the rest
  return resfix;
}


}