send location updates to server from web app

I have written a web app with a few JSP pages and Javaservlets running on a Tomcat server. The app needs to be able to send location updates to one of the Servlets (running on another server) every x seconds. I have found the html5 watchPosition(sucess_callback, error_callback) function to get the location updates from the web page. I'm thinking.. once I get the update from this function.. I'll put code in the success_callback function to send the update to a Servlet. But adding the watchPosition function to every JSP page in the app seems cumbersome. What is the right way to send periodic GPS updates to the server no matter whatever webpage the user is viewing in the app?