• Post Reply Bookmark Topic Watch Topic
  • New Topic

Where to write CleanUp Code ?  RSS feed

 
Rushi Patel
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having problem to perform Database Operation in jspDestroy method.

I am fetching detail from Database in index.jsp page. in jspInit method. and performing some operation on that detail to modify it. and when i want to stop my application and Tomcat Server @that time i want to write it back to database (the updated value).

But its showing me error for Database Connection and also my Database value remains same as it was.

So what can be the best way to write this Clean Up code ?

Summary:
------------
1) getting some values in jspInit method and setting it as Context Parameter.
2) Perfroming operation on that Context Parameter
3) Want to write Back the changed Value from jspDestroy method.......But its showing me error in that.

Both method are written in startup page (index.jsp)


Any Help regarding this would be appereciated.

Thank you...!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should most certainly not be doing this in a JSP. JSPs should only be used to create the HTML view. Please see this article for more info.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!