code: @Override
      protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
          Object value = filterModel(model);
          
          try {
          
              AmfTrace trace = null;
              if (log.isDebugEnabled()) {
                  trace = new AmfTrace();
              }
              
              ByteArrayOutputStream outBuffer = new ByteArrayOutputStream();
              SerializationContext context = new SerializationContext();
              Amf3Output out = new Amf3Output(context);
              if (trace != null) {
              	out.setDebugTrace(trace);
              }
              out.setOutputStream(outBuffer);
              out.writeObject(value);
              out.flush();
              
              outBuffer.flush();
              
              response.setContentLength(outBuffer.size());
              outBuffer.writeTo(response.getOutputStream());
              
              if (log.isDebugEnabled()) {
                  log.debug("Wrote AMF message:\n" + trace);
              }
          } finally {
              FlexContext.clearThreadLocalObjects();
              SerializationContext.clearThreadLocalObjects();
          }
      }
docs: {@inheritDoc}