O'Reilly logo

J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software by Art Taylor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Servlet Example

The following example demonstrates the process of creating a simple servlet to perform an XML transformation that ultimately produces an HTML page, which is returned to the client browser. The role of the servlet in this operation is that of a controller object; the real work to access the database, create XML, and transform the XML to HTML is being done by the objects the servlet has created. The result is a servlet focused on the task of creating a presentation component and delivering it to the browser that has generated the request.

The servlet retrieves the query to execute from an initialization parameter in the servlet web.xml file (shown in the next code example). The transformation is performed using an XSLT script located ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required