activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1387506 - /activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageServlet.java
Date Wed, 19 Sep 2012 09:57:36 GMT
Author: davsclaus
Date: Wed Sep 19 09:57:35 2012
New Revision: 1387506

URL: http://svn.apache.org/viewvc?rev=1387506&view=rev
Log:
AMQ-4043: Fixed web demo for simple send/receive.

Modified:
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageServlet.java

Modified: activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageServlet.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageServlet.java?rev=1387506&r1=1387505&r2=1387506&view=diff
==============================================================================
--- activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageServlet.java
(original)
+++ activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageServlet.java
Wed Sep 19 09:57:35 2012
@@ -52,6 +52,10 @@ import org.slf4j.LoggerFactory;
  */
 public class MessageServlet extends MessageServletSupport {
 
+    // its a bit pita that this servlet got intermixed with jetty continuation/rest
+    // instead of creating a special for that. We should have kept a simple servlet
+    // for good old fashioned request/response blocked communication.
+
     private static final long serialVersionUID = 8737914695188481219L;
 
     private static final Logger LOG = LoggerFactory.getLogger(MessageServlet.class);
@@ -132,7 +136,7 @@ public class MessageServlet extends Mess
                    ActiveMQTextMessage answer = new ActiveMQTextMessage();
                    answer.setText(body);
 
-                   writeResponse(request, response, answer);
+                   writeMessageResponse(response.getWriter(), answer);
                } catch (Exception e) {
                    IOException ex = new IOException();
                    ex.initCause(e);
@@ -249,10 +253,10 @@ public class MessageServlet extends Mess
             // handle any message(s)
             if (message == null) {
                 // No messages so OK response of for ajax else no content.
-                response.setStatus(HttpServletResponse.SC_OK);
-                response.setContentType("text/plain");
-                writer.write("No message received");
-                writer.flush();
+                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
+//                response.setContentType("text/plain");
+//                writer.write("No message received");
+//                writer.flush();
             } else {
                 // We have at least one message so set up the response
                 messages = 1;



Mime
View raw message