You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by gk...@apache.org on 2015/12/07 11:23:45 UTC

svn commit: r1718292 - in /turbine/core/trunk: pom.xml src/java/org/apache/turbine/modules/screens/JSONScreen.java src/test/org/apache/turbine/modules/actions/VelocityActionThrowsException.java

Author: gk
Date: Mon Dec  7 10:23:44 2015
New Revision: 1718292

URL: http://svn.apache.org/viewvc?rev=1718292&view=rev
Log:
- Upgrade content-type in JSONScreen.class
- Upgrade versions yaafi, commons-email

Modified:
    turbine/core/trunk/pom.xml
    turbine/core/trunk/src/java/org/apache/turbine/modules/screens/JSONScreen.java
    turbine/core/trunk/src/test/org/apache/turbine/modules/actions/VelocityActionThrowsException.java

Modified: turbine/core/trunk/pom.xml
URL: http://svn.apache.org/viewvc/turbine/core/trunk/pom.xml?rev=1718292&r1=1718291&r2=1718292&view=diff
==============================================================================
--- turbine/core/trunk/pom.xml (original)
+++ turbine/core/trunk/pom.xml Mon Dec  7 10:23:44 2015
@@ -825,7 +825,7 @@
     <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-email</artifactId>
-      <version>1.3</version>
+      <version>1.4</version>
       <type>jar</type>
     </dependency>
     <dependency>
@@ -898,7 +898,7 @@
     <dependency>
       <groupId>org.apache.fulcrum</groupId>
       <artifactId>fulcrum-yaafi</artifactId>
-      <version>1.0.6</version>
+      <version>1.0.7</version>
       <type>jar</type>
       <optional>true</optional>
     </dependency>

Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/screens/JSONScreen.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/screens/JSONScreen.java?rev=1718292&r1=1718291&r2=1718292&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/screens/JSONScreen.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/screens/JSONScreen.java Mon Dec  7 10:23:44 2015
@@ -70,7 +70,8 @@ import org.jabsorb.JSONRPCBridge;
  * }
  * </code>
  *
- * <p>This code is derived from the com.metaparadigm.jsonrpc.JSONRPCServlet
+ * <p>This code is derived from the com.metaparadigm.jsonrpc.JSONRPCServlet and (after upgrade) checked against 
+ * org.jabsorb.JSONRPCServlet.
  *
  * @author brad@folkens.com
  * @author <a href="mailto:seade@backstagetech.com.au">Scott Eade</a>
@@ -78,7 +79,7 @@ import org.jabsorb.JSONRPCBridge;
  */
 public class JSONScreen extends RawScreen
 {
-    protected static final String JSONRPC_CONTENT_TYPE = "text/plain";
+    protected static final String JSONRPC_CONTENT_TYPE = "application/json;charset=utf-8";
 
     protected final static int BUFFER_SIZE = 4096;
 
@@ -97,6 +98,8 @@ public class JSONScreen extends RawScree
 
     /**
      * Output the dynamic content.
+     * 
+     * Encodign is UTF-8. @{@link #JSONRPC_CONTENT_TYPE}: {@value #JSONRPC_CONTENT_TYPE}.
      *
      * @param pipelineData The PipelineData object.
      */
@@ -107,11 +110,8 @@ public class JSONScreen extends RawScree
         data.declareDirectResponse();
         HttpServletRequest request = data.getRequest();
 
-        String charset = request.getCharacterEncoding();
-        if(charset == null)
-        {
-            charset = "UTF-8";
-        }
+        // we require utf-8, cft
+        String charset =  "UTF-8"; //request.getCharacterEncoding();
         BufferedReader in = new BufferedReader(new InputStreamReader(request.getInputStream(), charset));
 
         // Read the request

Modified: turbine/core/trunk/src/test/org/apache/turbine/modules/actions/VelocityActionThrowsException.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/test/org/apache/turbine/modules/actions/VelocityActionThrowsException.java?rev=1718292&r1=1718291&r2=1718292&view=diff
==============================================================================
--- turbine/core/trunk/src/test/org/apache/turbine/modules/actions/VelocityActionThrowsException.java (original)
+++ turbine/core/trunk/src/test/org/apache/turbine/modules/actions/VelocityActionThrowsException.java Mon Dec  7 10:23:44 2015
@@ -30,7 +30,7 @@ import org.apache.velocity.context.Conte
  *
  * @author     <a href="mailto:epugh@upstate.com">Eric Pugh</a>
  * @author <a href="mailto:peter@courcoux.biz">Peter Courcoux</a>
- * @created    October 11, 2002
+ * @since    October 11, 2002
  */
 public class VelocityActionThrowsException extends VelocityAction
 {
@@ -39,7 +39,7 @@ public class VelocityActionThrowsExcepti
     /**
      *  Default action is throw an exception.
      *
-     * @param  pipelineData           Current PipelineData information
+     * @param  data           Current PipelineData information
      * @param  context        Context to populate
      * @exception  Exception  Thrown on error
      */
@@ -52,7 +52,7 @@ public class VelocityActionThrowsExcepti
 
     /**
      * This action event also throws an exception.
-     * @param pipelineData
+     * @param data
      * @param context
      * @throws Exception
      */