Variable declaration

Variable declaration: variable defined as declaration of the servlet class into which the jsp page is translated and compiled. Consider the following declaration                                                       of three variables:

<%! private int x=0,y=0; private String units=”ft”; %>

This declaration will have the effect of creating three instance variable in the servlet created for the jsp ,named x,y,units.when declaring JSP instance variable ,it is important to keep in mind the potential that multiple thread will be accessing a JSP simultaneously ,representing multiple simultaneous page request

Leave a Reply

Your email address will not be published. Required fields are marked *