Scripting elements

Scripting elements manipulate objects and perform computations. The character sequence that precedes a scripting element depends on the element’s type: <% for a scriptlet, <%= for an expression, and <%! for a declaration. Scriptlets, expressions, and declarations are all closed with the sequence %>.

Scriptlets

Scriptlets contain a code fragment valid in the scripting language:

<% cart.processRequest(request); %>

Expressions

Expressions contain an expression valid in the page scripting language:

Value="<%= request.getParameter("amount") %>"

Declarations

A declaration declares variables or methods valid in the page scripting language (usually Java, but other languages can be defined in the page directive):

<%! Connection myconnection; String mystring; %>