7.What are the types of scripting elements?
There are three types of scripting elements:
- Scriptlets
- Declaration
- Expression
8. How to create a scriptlet?
Scriptlets are embedded between <% and %> delimiters.
Syntax: <% java code goes in here %>
9. What is declaration element?
- Declarations are used to declare, define methods and instance variables.
- Declaration tags does not produce any output that is sent to client.
- The methods and classes declared will be translated as class level variables and methods during translation.
10. How to declare methods or variables in JSP?
Methods or variables are declared using <%! and %> delimiters.
Syntax: <%! variable=0; %>
11. What is expression element?
Expression element are used to write dynamic content back to the client browser. It is used in place of out.print() method. Only expressions are supported inside the tag. Declarations of methods and variables is not possible inside this tag.