Contains a validProgramSegment.
JSP syntax
<% Code fragment %>
Example
<%
String name = NULL;
If (request. getparameter ("name") = NULL ){
%>
<% @ Include file = "error.html" %>
<%
} Else {
Foo. setname (request. getparameter ("name "));
If (FOO. getname (). inclusignorecase ("Integra "))
Name = "Acura ";
If (name. inclusignorecase ("Acura ")){
%>
Description
A scriptlet can contain multiple JSP statements, methods, variables, and expressions.
Because of scriptlet, we can do the following:
declare the variables or methods to be used (refer to Declaration ).
compile a JSP expression (reference expression ).
use any implied object and any object declared with
to write JSP statements (if you are using Java, these statements must comply with Java Language Specification ).
any text, HTML tag, and JSP elements must be excluded from scriptlet
when JSP receives the customer's request, the scriptlet will be executed. If the scriptlet contains the displayed content, the displayed content is included in the out object.