• Post Reply Bookmark Topic Watch Topic
  • New Topic

Add Database down alert

 
vicky sha
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wanted to add Database down alert for all jsp pages and i can do it in single page. As there are almost 1000 pages in my project, anyone can tell me where should i call database down alert function so that it can be accessible at every page reload and throw the user at error page.
Thanks in advance.
 
Pyla Rao
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We can use custom exception handling for those types of alerts.
 
vicky sha
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have used the same for single jsp file(action script of it) and its working fine. But the problem is i have almost 1000 jsp files(including action scripts) and add these exception handling in all action script is not a good idea.
So i need to know how do i make changes to any single action script or controller so that it can be called at any page reload?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A servlet filter that transforms the response -maybe by inserting a JavaScript alert at the end of the response- can do this.

A better approach would be to do this in a JSP fragment that all pages include, but that would mean altering all JSP pages.

As an aside, if you have that many JSPs, then it may be time to redesign the app to use a CMS.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!