• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jspInit() and jspDestroy()

 
Shreyas Reddy
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a JSP, if we want to redefine these two methods, do we declare init() and destroy() or jspInit() and jspDestroy()?
Thx in advance
 
Sainudheen Mydeen
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
It is jspInit() and jspDestroy().
-Sainudheen
 
Dong Shing
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Shreyas Reddy:
In a JSP, if we want to redefine these two methods, do we declare init() and destroy() or jspInit() and jspDestroy()?
Thx in advance

You don't have to declare these two method. You just overwrite them like followings.
<html>
<body>
<%@ page language="java" %>
<%! int count = 0; %>
<% count++; %>
Welcome! You are visitor munber:
<%= count %>
<% jspInit() {
//your stuff goes here.
}
jspDestroy() {
//your stuff goes here.
}
%>
</body>
</html>
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic