JSP scripting elements let you insert Java code into the servlet that will be generated from the JSP page. There are three forms:

1. Expressions of the form <%= Java Expression %>, which are evaluated and inserted into the servlet’s output.

2. Scriptlets of the form <% Java Code %>, which are inserted into the
servlet’s _jspService method (called by service).

3. Declarations of the form <%! Field/Method Declaration %>, which are inserted into the body of the servlet class, outside any existing methods.

Each of these scripting elements is described in more detail in the following
sections.