Package loxia.support.json

Examples of loxia.support.json.AbstractJSONObject


        }
        response.setHeader("Content-Disposition", "inline");


        PrintWriter writer = response.getWriter();
        AbstractJSONObject jo = null;
       
        Map request  = (Map)invocation.getInvocationContext().get("request");
        Map<String,Object> exceptionMap = (Map<String,Object>)request.get("exception");
        if(exceptionMap != null){
          logger.debug("Exception found:" + exceptionMap);
          Map<String,Object> resultMap = new HashMap<String, Object>();
          Map<String,Object> eMap = new HashMap<String, Object>();
          eMap.put("obj", new JSONObject(exceptionMap.get("exception")));
          eMap.put("message", new JSONArray((List<String>)exceptionMap.get("errorMessages")));
          resultMap.put("exception", new JSONObject(eMap));
          if(exceptionMap.get("invalidToken") != null){
            resultMap.put("invalidToken", true);
            resultMap.put("token", exceptionMap.get("token"));
          }
          jo = new JSONObject(resultMap);
        }else{       
          jo = (AbstractJSONObject)request.get("json");         
        }
       
        if(jo != null){
          logger.debug(jo.toString());
          writer.write(jo.toString());         
        }
       
        if (writer != null) {
            writer.flush();
            writer.close();
View Full Code Here

TOP

Related Classes of loxia.support.json.AbstractJSONObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.