Change page refresh

From OpenNMS

Use Case

Sometimes, the standard 300 second (5 minute) refresh is not good enough for some applications, (for example, an alarm listing monitor for all to see). In that case, you may want the page to refresh much quicker.

Or, you may want your dashboard to have the latest up-to-date information. Even though you may have the refresh set to 30 seconds in the surveillance-view.xml file, your web session may have timed-out, and therefore, won't receive any updates.

This can be verified by choosing any other link, and shown a login page.

By forcing a refresh on /dashboard.jsp, you are resetting the session-idle timer.

Editing web.xml

Inside the web.xml file are pre-defined filters to inject refresh headers into whatever pages you want.

The web.xml file can be found at $OPENNMS_HOME/jetty-webapps/opennms/WEB-INF/web.xml if you are using JETTY or $OPENMS_HOME/webapps/opennms/WEB-INF/web.xml if you are using TOMCAT

While you can place this anywhere in the web.xml file, you *should* place this with the other <filter-mapping> elements for easier maintainability.

The below filter-mapping will inject a 30-second refresh for the stated URL (i.e. /dashboard.jsp)

<filter-mapping>
    <filter-name>AddRefreshHeader-30</filter-name>
    <url-pattern>/dashboard.jsp</url-pattern>
</filter-mapping>

The available, pre-defined Refresh <filter-name>'s are:

  1. AddRefreshHeader-300
  2. AddRefreshHeader-120
  3. AddRefreshHeader-30

Each for the number of seconds they will inject.

Personal tools
DevJam 2008 Sponsors
DevJam 2008 Sponsor: Google
DevJam 2008 Sponsor: Netregistry
DevJam 2008 Sponsor: Papa John's
NewEdge Networks
OpenNMS takes home the gold award!
Join the Free Software Foundation
Support This Project Commercial OpenNMS Support OpenNMS Italia Get OpenNMS at SourceForge.net. Fast, secure and Free Open Source software downloads Our Network Simulator Our Java Profiler