cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1091450 - /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestPreprocessor.java
Date Tue, 12 Apr 2011 15:15:35 GMT
Author: sergeyb
Date: Tue Apr 12 15:15:35 2011
New Revision: 1091450

URL: http://svn.apache.org/viewvc?rev=1091450&view=rev
Log:
[JAX-RS] Minor update for debugging Content-Types

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestPreprocessor.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestPreprocessor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestPreprocessor.java?rev=1091450&r1=1091449&r2=1091450&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestPreprocessor.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestPreprocessor.java
Tue Apr 12 15:15:35 2011
@@ -41,6 +41,7 @@ import org.apache.cxf.message.Message;
 public class RequestPreprocessor {
     
     private static final String ACCEPT_QUERY = "_type";
+    private static final String CTYPE_QUERY = "_ctype";
     private static final String METHOD_QUERY = "_method";
     private static final String METHOD_HEADER = "X-HTTP-Method-Override";
     
@@ -76,6 +77,7 @@ public class RequestPreprocessor {
         
         MultivaluedMap<String, String> queries = u.getQueryParameters();
         handleTypeQuery(m, queries);
+        handleCType(m, queries);
         handleMethod(m, queries, new HttpHeadersImpl(m));
         Response r = checkMetadataRequest(m);
         if (r == null) {
@@ -153,6 +155,13 @@ public class RequestPreprocessor {
         }
     }
     
+    private void handleCType(Message m, MultivaluedMap<String, String> queries) {
+        String type = queries.getFirst(CTYPE_QUERY);
+        if (type != null) {
+            m.put(Message.CONTENT_TYPE, type);
+        }
+    }
+    
     @SuppressWarnings("unchecked")
     private void updateAcceptTypeHeader(Message m, String acceptValue) {
         m.put(Message.ACCEPT_CONTENT_TYPE, acceptValue);



Mime
View raw message