O'Reilly logo

Sams Teach Yourself J2EE™ in 21 Days by Peter Roxburgh, Andy Longshaw, Debbie Law, Dan Haywood, Martin Bond

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

Agency Case Study

You will now add a servlet to the Agency case study. The servlet sends the contents of the agency database tables to be displayed by a browser. The rows of the tables are formatted as an HTML table.

The servlet first outputs an HTML form on which the user selects the name of a table from a pull-down list (see Figure 12.25).

Figure 12.25. AgencyTable form.

After the user clicks the Submit Query button, the servlet displays the contents of this table on the same page.

AgencyTable Servlet Code

The AgencyTable servlet overrides the init() method to obtain the servlet context along with the JNDI context for the Agency EJB. The Agency ...

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