• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Where to write CleanUp Code ?  RSS feed

 
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...!
 
Sheriff
Posts: 67257
170
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!