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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access