• October 6, 2014
  • JSP
  • Comments Off on JSP Scriptlet tag

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.

Related Topics:

How to build java project using ant in eclipse?
JAXB marshalling – convert java object to xml example.
How to create pdf file in java using iText jar?
Generics class example.
OGNL in struts 2.
Hibernate One-to-One Mapping using xml.
Send inline image in email using JavaMail API.
Quartz 2 JobListener example.


Comments are closed.