Class 2 |
Intermediate Java 30-IT-397 |
|
Mixing Scriptlets and HTML
-
You can mix scriptlets with HTML to make part of the HTML conditional,
or looping.
-
All you have to do is keep the Java within the <% %> tags, and the HTML
out. The compiler will take care of the rest.
JSP Declarations
-
You can define methods and fields outside of the _jspService method that
gets called to generate the page.
-
Put the declaration between <%! and %>
-
Use to supplement your scriptlets.
Example

Created by: Brandan Jones
December 17, 2001