Bringing It All Together

Next is the JSP that will bring everything together. This JSP will connect to a database and execute a statement that will produce a ResultSet. After that, the ResultSet will be passed into the newly created RStoXML and used to obtain a JDOM representation. This will then be transformed with a stylesheet, and the results output.

The TableSort.xsl stylesheet will create an HTML table whose label cells are links. Each of these links will provide the column number in the query string, so that when the string is followed, the JSP will obtain this parameter from the URL. Once obtained, that value will be passed into the stylesheet to result in the appropriate sort.

After parsing the import statements, DBtoXML.jsp parses the ...

Get JSP™ and XML Integrating XML and Web Services in Your JSP™ Application now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.