Links are able to display?
Like so
... String val = result.getString(i); String id = i == 1 ? val : id; String href = request.getContextPath() + pathToRecordServlet + "?id=" + id; out.write("<td><a href=\"" + href + \">" + val + "</a></td>"); ...
pathToRecordServlet - here should be the path to the servlet that will display the page with the string. For example, if your application is called MyApp, and the servlet is available at http: // server / MyApp / RecordServlet , then pathToRecordServlet = "/ RecordServlet".
id is a unique string identifier. The example assumes the id in the first column.
Thus, you will get a link in each column by clicking on which you will go to a page with a single line.
request.getContextPath() returns "/MyApp" , pathToRecordServlet = "/RecordServlet" , id let it be 3 . The link should get this
<a href="/MyApp/RecordServlet?id=3">...</a>
The servlet that is responsible for this page should look at the id parameter, extract from the database or otherwise get the desired string. Well, then draw it somehow.
To work by clicking anywhere in the line, and not just by reference, you need to make a script. It must determine which cell is clicked and extract a link from it.