Scriptlets
JSP pages can include small scripts in a page. These are code fragments that are executed at request time processing.
May be combined with static elements on the page or other objects in the Java servlet environment.
Anything contained with <% and %> or <%! and %> is evaluated by the script language engine, normally the Java virtual machine on the host.
Declarations: the scope is the JSP file, including the include files. Declare variables or methods.
- <%! int a, b; double c = 0.0; %>
- <%! Color c = new Color ( 0, 128, 255); %>
Expressions: any language expression, casts result to a String