tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r691664 - in /tomcat/trunk/java/org/apache/tomcat/bayeux: RequestBase.java request/MetaHandshakeRequest.java
Date Wed, 03 Sep 2008 16:28:43 GMT
Author: fhanik
Date: Wed Sep  3 09:28:41 2008
New Revision: 691664

URL: http://svn.apache.org/viewvc?rev=691664&view=rev
Log:
a fully working demo, had to set the content type for the new version of the dojo toolkit
to properly parse the json data, otherwise it thinks it is xml

Modified:
    tomcat/trunk/java/org/apache/tomcat/bayeux/RequestBase.java
    tomcat/trunk/java/org/apache/tomcat/bayeux/request/MetaHandshakeRequest.java

Modified: tomcat/trunk/java/org/apache/tomcat/bayeux/RequestBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/bayeux/RequestBase.java?rev=691664&r1=691663&r2=691664&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/bayeux/RequestBase.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/bayeux/RequestBase.java Wed Sep  3 09:28:41 2008
@@ -163,6 +163,14 @@
             log.debug("["+Thread.currentThread().getName()+"] Delivering message to[" + to
+ "] message:" + jsonstring);
         }
 
+        if (to!=null) {
+            if (to.useJsonFiltered()) {
+                if (!event.getHttpServletResponse().isCommitted()) event.getHttpServletResponse().setContentType("text/json-comment-filtered");
+            }else {	
+                if (!event.getHttpServletResponse().isCommitted()) event.getHttpServletResponse().setContentType("text/json");
+            }
+        }
+
         PrintWriter out = event.getHttpServletResponse().getWriter();
         if (to==null) {
             //do nothing

Modified: tomcat/trunk/java/org/apache/tomcat/bayeux/request/MetaHandshakeRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/bayeux/request/MetaHandshakeRequest.java?rev=691664&r1=691663&r2=691664&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/bayeux/request/MetaHandshakeRequest.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/bayeux/request/MetaHandshakeRequest.java Wed Sep 
3 09:28:41 2008
@@ -93,11 +93,6 @@
             clientId = client.getId();
             client.setSupportedConnTypes(suppConnTypesFlag);
             client.setUseJsonFiltered(getExt().get(Bayeux.JSON_COMMENT_FILTERED_FIELD) !=
null);
-            if (client.useJsonFiltered()) {
-            	event.getHttpServletResponse().setContentType("text/json-comment-filtered");
-            }else {
-            	event.getHttpServletResponse().setContentType("text/json");
-            }
             response.put(Bayeux.CLIENT_FIELD, client.getId());
             ((HashMap) response.get(Bayeux.ADVICE_FIELD)).put(Bayeux.RECONNECT_FIELD, Bayeux.RETRY_RESPONSE);
             ((HashMap) response.get(Bayeux.ADVICE_FIELD)).put(Bayeux.INTERVAL_FIELD, getReconnectInterval());



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message