JSP - Scriptlet Tag
JSP Scriptlet
JSP Scriptlet Tag में java का code दिया जाता है | इस java के code में variables, methods या classes के declarations और expressions हो सकते है |
Syntax for Scriptlet Tag
<% java code %>OR
<jsp:scriptlet> Java Code </jsp:scriptlet>
Example for Scriptlet Tag
Source Code :Output :<html> <head> <title>Scriptlet Tag - Declare and Print Variable</title> </head> <body> <% int a = 1, b = 2; %> <% out.print("Value of a : " + a + "<br />"); %> <jsp:scriptlet> out.print("Value of b : " + b); </jsp:scriptlet> </body> </html>
Value of a : 1 Value of b : 2