Programming Tutorials

What is JSP declaration?

By: Karthik in Interview Tutorials on 2012-06-16  

Answer: JSP Decleratives are the JSP tag used to declare variables. Declaratives are enclosed in the <%! %> tag and ends in semi-colon. You declare variables and functions in the declaration tag and can use anywhere in the JSP. Here is the example of declaratives:

<%@page contentType="text/html" %>
    int cnt=0; 
    private int getCount(){ 
    //increment cnt and return the value 
    return cnt; 
<p>Values of Cnt are:</p>

Add Comment

* Required information


No comments yet. Be the first!

Most Viewed Articles (in Interview )

Latest Articles (in Interview)