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" %>
<html>
<body>
<%! 
 int cnt=0; 
 private int getCount(){ 
 //increment cnt and return the value 
 cnt++; 
 return cnt; 
 } 
 %>
<p>Values of Cnt are:</p>
<p><%=getCount()%></p>
</body>
</html> 



(追記) (追記ここまで)


Add Comment

JavaScript must be enabled for certain features to work
* Required information
1000

Comments

No comments yet. Be the first!
(追記) (追記ここまで)
(追記) (追記ここまで)

AltStyle によって変換されたページ (->オリジナル) /