JSP Declaration Tag


Prev Tutorial Next Tutorial

JSP Declaration Tag

This is used to declare variable and methods in jsp page will be translate and define as class scope declaration in .java file.

The variable and methods will become global to that jsp. It means in that jsp we can use those variables any where and we can call those method any where.

At the time of translation container inserts the declaration tag into the class. So the variables become instants variables and methods will become instants methods.

The code written inside the jsp declaration tag is placed outside the service() method of auto-generated Servlet, so it does not get memory at each request.

Syntax

<%! variable declaration or method declaration %>

Prev Tutorial Next Tutorial

Advertisements




Facebook Likes

Advertisements