protected void doPost(HttpServletRequest httpServletRequest,
      HttpServletResponse httpServletResponse) throws
      ServletException, IOException {
   Map valMap = httpServletRequest.getParameterMap();
   StringBuffer body = new StringBuffer("{\n");

   if(valMap != null) {
      String val=null;
      String key = null;
      Map.Entry me = null;
      Set entries = valMap.entrySet();

      int size = entries.size();
      int counter=0;
      for(Iterator iter= entries.iterator();iter.hasNext();) {
         counter++;
         me=(Map.Entry) iter.next();
         val= ((String[]me.getValue())[0];
         key = (String) me.getKey();
         if (counter < size){
            body.append(key).append(":\"").append(val).append("\",\n");
         } else {
            // Usunicie przecinka z ostatniego wpisu.
            body.append(key).append(":\"").append(val).append("\"\n");
         }
      }
   }
   body.append("}");
   AjaxUtil.sendText(httpServletResponse,body.toString());
}
