title: How to build Online and offline versions of same web application
body: <p><strong>Background Information:</strong>
  The organization where am working uses Java, Oracle ADF framework,Oracle db/weblogic server stack. </p>
  
  <p><strong>New Requirement</strong>
  I have this tricky requirement for a new project to make the web application that I am building on to work offline also. As per the requirements a user should be able to click on a 'Work offline' button while in the 'online' mode and be able to get a local copy of the application/or page to their device. </p>
  
  <p>And once the user complete the data entry in the offline version of the application downloaded to their local device, then the user should be able to click on a 'Submit' button and upload the local details to the server (ie. to the main production server. And it is to be done when there is internet connectivity).</p>
  
  <p><strong>The solution am trying to proceed with is as follows:</strong></p>
  
  <ol>
  <li>I build a std web application to work on the production online mode.
  It will use ADF or /JSF with Oracle db.</li>
  <li>I will build a simple application for offline mode which will reuse
  most of the pages developed for online mode.  But the database use
  will be a lightweight one like hsqldb. And the whole application
  will be bundled with a lightweight server like jetty.   </li>
  <li>The whole offline application and server will be bundled together as
  an executable jar which can be downloaded and run from any device.</li>
  <li>The local offline version of the app will have a 'submit' button.
  And on clicking this button when there is internet conectivity then
  we will make a webservice call to the production server, and submit
  the data collected</li>
  </ol>
  
  <p><strong>My Questions :</strong></p>
  
  <ol>
  <li>Will my proposed solution work ? ...is there a better way to do this? </li>
  <li>Is hsqldb the best lightweight embedded database for offline mode?</li>
  <li>Is jetty a good lightweight embedded web server?...is there a better
  one ?</li>
  <li>Can an executable jar be run on any device like
  mac,ios,linux,android,windows etc.</li>
  </ol>