JSP Scriptlet tag

Scriptlet tag contains the any no. of java code statements. It may contain variables declaration or valid expressions. When JSP is translated into servlet, java code written in the scriplet tag is moves to the _jspService() method by web container.   Syntax:

<%  java code %>

Note: Variable and methods declare in scriplet tag are not of class level declaration.



		<title>Scriplet tag example</title>
			out.println("Sum of 10 and 20 = ");
			out.print(10 + 20);




jsp example 2   Download this example.   Next Topic: JSP Declaration tag with example. Previous Topic: JSP Hello World Example.


Please follow and like us:
Content Protection by DMCA.com