Class JSONUtils


  • public final class JSONUtils
    extends Object
    Provides json utility methods for forms
    • Method Detail

      • getUploadedFileJSON

        public static net.sf.json.JSONObject getUploadedFileJSON​(List<org.apache.commons.fileupload.FileItem> listFileItem)
        Builds a json object for the file item list. Key is JSON_KEY_UPLOADED_FILES, value is the array of uploaded file.
        Parameters:
        listFileItem - the fileItem list
        Returns:
        the json
      • buildJsonErrorRemovingFile

        public static net.sf.json.JSONObject buildJsonErrorRemovingFile​(javax.servlet.http.HttpServletRequest request)
        Builds a json object with the error message.
        Parameters:
        request - the request
        Returns:
        the json object.
      • buildJsonError

        public static void buildJsonError​(net.sf.json.JSONObject json,
                                          String strMessage)
        Builds a json object with the error message.
        Parameters:
        json - the JSON
        strMessage - the error message