How to Embed a RAP Application in a Web Page

A slightly overlooked aspect of RAP Applications is that they do *not* have to take the whole page in your browser. Instead they can also be embedded into an existing web page. The example below is embedded into this blog post and is fully usable. My pet-term for such an application is “RAPplet” – kinda like an applet but without the need for a JVM in the browser.


Note: if you do not see a rap application above this text, your xml-based feed reader has swallowed the example :-o. Visit the current post with your browser!

Embedding a RAP Application in a Web Page

A straightforward iframe element will do the trick, as shown in the snippet below:

  src="" width="675" height="300" frameborder="0" name="maildemo">
<p>Sorry your browser does not support iframes.</p>

Happy hacking,

9 Responses to “How to Embed a RAP Application in a Web Page”

  1. Chris Aniszczyk (zx) says:


  2. AlBlue says:

    Shows up as a Server Error 500 and a NullPointerException for me.

  3. Chris Aniszczyk (zx) says:

    Is the source of this example available anywhere?

  4. GrimTim says:

    I get:


    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.23 logs.

  5. Elias Volanakis says:

    @Chris: the source is not available yet. I will do a posting about .war deployment and include the source there. If you want it earlier I can send it by email. It’s tiny anyway (3 classes).

    @alblue, grimtim: hmm, try reload :). The weird thing about the full stacktrace is that none of my code is on it. I’ll have a look at this though. Did you do something specific that could help me reproduce it?


  6. Willian Mitsuda says:

    Cool, but a little slow. Does it take a roundtrip to the server every time a button is pressed?

  7. Elias Volanakis says:

    @alblue, grimtim: the NullPointerException in HtmlResponseWriter was a RAP-bug that has been fixed in the meantime. I’m deploying a new version that has been compiled against RAP HEAD instead of RAP 1.0.

    @willian: yes, currently each click causes a round trip.


    PS: The calculator will be offline for the next 10 minutes or so…

  8. Anonymous says:

    “PS: The calculator will be offline for the next 10 minutes or so…”

    Maybe you meant the next 10 months? :)

  9. Elias Volanakis says:

    Hi anonymous,

    the RAP calculator is currently offline.

    I need a new server for hosting it. I’ll post a comment once i’ve found a new home for it.


9 responses so far

Written by . Published in Categories: EclipseSource News