Class Ajax


  • public class Ajax
    extends java.lang.Object
    Returns proper Ajax response from input data
    Author:
    Ruslan Nazirov
    • Constructor Summary

      Constructors 
      Constructor Description
      Ajax()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.Object> emptyResponse()
      Returns success AJAX response without any additional data
      static java.util.Map<java.lang.String,​java.lang.Object> errorResponse​(java.lang.String errorMessage)
      Returns AJAX response with error message
      static java.util.Map<java.lang.String,​java.lang.Object> successResponse​(java.lang.Object object)
      Returns success AJAX response, populated with provided data
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Ajax

        public Ajax()
    • Method Detail

      • successResponse

        public static java.util.Map<java.lang.String,​java.lang.Object> successResponse​(java.lang.Object object)
        Returns success AJAX response, populated with provided data
        Parameters:
        object - Data, which will be return with Ajax response
        Returns:
        Ajax response data, which can be returned in MVC controller
      • emptyResponse

        public static java.util.Map<java.lang.String,​java.lang.Object> emptyResponse()
        Returns success AJAX response without any additional data
        Returns:
        Ajax response data, which can be returned in MVC controller
      • errorResponse

        public static java.util.Map<java.lang.String,​java.lang.Object> errorResponse​(java.lang.String errorMessage)
        Returns AJAX response with error message
        Parameters:
        errorMessage - error message to return
        Returns:
        Ajax response data, which can be returned in MVC controller