Block declaration description
Declares a script language variable or method. The content must be a complete and valid statement written in the language defined by the page command. The embedded JSP object is invisible to the declared element. The variables declared here are processed as member variables of the compilation unit.
Syntax
Syntax 1 JSP page
<%! Declaration %>
Syntax 2 JSP document
<JSP: Declaration> declaration </jsp: Declaration>
Example
<%! Int globalcounterter = 0%>
<JSP: Declaration>
Void doit (){}
</Jsp: Declaration>Expression block description
You can add the result of executing a script expression to the response. The START character and end character must be a complete and valid expression. Built-in objects are visible in expressions.
Syntax
Syntax 1 JSP page
<% = Expression %>
Syntax 2 JSP document
<JSP: expression> Expression </jsp: expression>
Example
<% = Globalcount ++ %>
<JSP: expression> "Hello world! "</Jsp: expression>
Script block description
It can be used to embed script code snippets into pages. All the small scripts on the page must be combined to form legal script language statements. All built-in objects are visible in small scripts.
Syntax
Syntax 1 JSP page
<% Scripting code fragment %>
Syntax 2 JSP document
<JSP: scriptlet> scripting code fragment </jsp: scriptlet>
Example
<% For (INT I = 0; I <10; ++ I) {%>
<B> Hello wrold! </B> <br>
<% }%>