The Movies Listing Servlet
The movies are listed using the MoviesChooser servlet shown below. This servlet reads values from the session object to get the name of the SQL query to execute and the name of the XSLT template to use. These values relate to the names of init parameters in the web.xml file for the servlet context where the movie store application is deployed. We retrieve the session values and the corresponding init parameter values in the doGet method, since the shared servlet code may potentially have different callers from different sessions.
Within the doGet method, the query is executed (using the getQueryResults method) and the results are returned as an XML document. An XML parser and transformer are then created using the XSLT ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access