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

Summary

Today, you have seen how servlets can be employed in a Web application to add dynamic content to HTML pages. You learned that servlets have no client interface, and the servlet container controls its lifecycle. Because HTTP is a stateless protocol, servlets have to use external means to retain information between page accesses. Cookies are one method, but when cookies cannot be used, a servlet can use hidden fields or URL rewriting. You have also seen that with event listening and using servlet filters, you can further extend the functionality and reusability of your servlet Web applications.

Servlets generate HTML from within Java code. This works well when the amount of HTML is relatively small, but the coding can become onerous if ...

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