I'm wondering why not use the HTML widget for this instead of gquery. You could then use Messages to return a SafeHtml and set it using htmlWidget.setHtml(messages.method(placeholder1, placeholder2))