Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1399577 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
dejanb committed Oct 18, 2012
1 parent 65af81e commit 51eb87a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions activemq-web-demo/src/main/webapp/websocket/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $(document).ready(function(){

// this allows to display debug logs directly on the web page
client.debug = function(str) {
$("#debug").append(str + "\n");
$("#debug").append(document.createTextNode(str + "\n"));
};
// the client is notified when it is connected to the server.
var onconnect = function(frame) {
Expand All @@ -39,7 +39,7 @@ $(document).ready(function(){
$('#send_form_input').removeAttr('disabled');

client.subscribe(destination, function(message) {
$("#messages").append("<p>" + message.body + "</p>\n");
$("#messages").append(document.createTextNode("<p>" + message.body + "</p>\n"));
});
};
client.connect(login, passcode, onconnect);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t
}
out.print(refreshRate);
out.println("'/></head>");
out.println("<body>Published <b>" + count + "</b> of " + total + " price messages. Refresh = " + refreshRate + "s");
out.println("<body>Published <b>" + escape(Integer.toString(count)) + "</b> of " + escape(Integer.toString(total))
+ " price messages. Refresh = " + escape(refreshRate) + "s");
out.println("</body></html>");

} catch (JMSException e) {
Expand Down Expand Up @@ -129,4 +130,8 @@ protected int getNumberOfMessages(HttpServletRequest request) {
}
return 1;
}

protected String escape(String text) throws IOException {
return java.net.URLEncoder.encode(text, "UTF-8");
}
}

0 comments on commit 51eb87a

Please sign in to comment.