O'Reilly logo

Head First Servlets and JSP, 2nd Edition by Bert Bates, Bryan Basham, Kathy Sierra

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

The way we SHOULD have done it

Here we took the opening and closing tags out of the included files. This does mean that the included files can no longer generate valid HTML pages on their own; they now depend on being included in something bigger. Something with <html><body> and </body></html> tags. But that’s the point—you’re designing these reusable chunks so that you can compose complete layouts from smaller pieces, without duplicating the code by hand. These reusable chunks aren’t meant to live on their own.

image with no caption
image with no caption
image with no caption

Note

Note: this idea of stripping out the opening and closing tags applies to BOTH include mechanisms—<jsp:include> and the include directive.

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