title: How to configure a default URL/HTTP handler with DJNativeSwing
body: <p>Overview:
      I am creating a Swing application which has an embedded web browser(DJ Native Swing). This web browser needs to be able to display content that is decrypted on the fly using Java and GPG.</p>
  
  <p>So, say you have a simple a.html which contains something like this:</p>
  
  <pre><code>&lt; html &gt;
  &lt; body &gt;
  Hello world
  &lt; img src="b.jpg"&gt;
  &lt; /body&gt;
  &lt;/ html&gt;
  </code></pre>
  
  <p>The handler first should see the request for "a.html", our handler would then
      locate the file a.html.gpg(encrypted file), convert it to a.html, open it and write the bytes
      back to the browser as handler result.</p>
  
  <p>Now the browser looks at the content and realizes that another request needs to
      be made so it tries to access b.jpg. Our handler should see that request and
      repeat the logic, now sending the bytes that make up b.jpg back as result.</p>
  
  <p>So what we really want is to intercept every HTTPRequest for a.html, b.jpg and the custom code in the URL handler would go and decrypt that file and serve up the bytes which the browser should consume and render the web component on the page.</p>
  
  <p><strong>THE DECRYPTION LOGIC IS FINE, just need a way to intercept the URL and for JWebBrowser to be able to consume the decrypted bytes to render the page.</strong></p>
  
  <p>I did see a method  WebServer.addContentProvider(HTTPRequest req) but couldn't figure out how to use this. Any alternative way to fulfill the requirement with Dj Native Swing is also appreciated.</p>