Day 13. JavaServer Pages

Yesterday, you looked at developing Web applications using Java servlets. Servlets have the advantage of being able to generate the HTML Web page dynamically. The disadvantage of servlets is the developer must generate the HTML formatting information from within Java, and this means a lot of out.println statements. Servlets can be described as large amounts of boring HTML statements interspersed with small amounts of interesting Java code.

Servlets make it difficult to differentiate the presentation layer from the logic layer of an application. This duality of purpose means that servlets do not allow the roles of HTML designer and Java programmer to be easily separated. Writing servlets requires the members of the development ...

Get Sams Teach Yourself J2EE™ in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.