JSP – Scriptlet Tags

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.


<%  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);
Scroll to Top