You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by jo...@gmail.com on 2010/01/04 23:15:26 UTC
Re: Extend concat servlet to support json concatination (issue183045)
http://codereview.appspot.com/183045/diff/1/2
File
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ConcatProxyServlet.java
(right):
http://codereview.appspot.com/183045/diff/1/2#newcode47
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ConcatProxyServlet.java:47:
public static final String ASJSON_PARAM = "asJSON";
Thinking on this more, IMO it makes sense to tweak this a little bit.
Rather than asJSON=1, I propose:
&json=<symbol>
The output will then be:
var <symbol> = <JSON>;
...rather than the fixed symbol "_js".
http://codereview.appspot.com/183045/diff/1/2#newcode101
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ConcatProxyServlet.java:101:
if (isAsJson) {
how about putting the asJson logic into the wrapper itself:
ResponseWrapper.setJsonVar("_js"); // "_js" actually from query
...the above, when non-null, does JSON-escaping; otherwise existing
behavior.
http://codereview.appspot.com/183045