Some JSP Examples

We already know that the JSP page includes HTML tags interspersed with special JSP tags. These tags can contain attributes, or a body, which is interpreted by the compiler. The <% tag on the page indicates to the JSP compiler that Java code follows, and a %> indicates to the compiler that this is the end of Java code.

The Java code contained within a block of these tags is not a formal Java class declaration with data members and method declarations; instead it is a fragment of Java code used by the JSP parser to construct the Java code that will be executed when the JSP is accessed. A particular section of the code fragment does not need to be a completed code block, but when the parsing of the JSP is complete, a Java code ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software 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.