Class JsonResponse

java.lang.Object
org.broadleafcommerce.common.web.JsonResponse

public class JsonResponse extends Object
Used when a controller typically returns a String that represents a view path but would like to return a JSON response in other scenarios, such as an error case.

Example Usage:

return new JsonResponse(response) .with("status", "ok") .with("shouldRefresh", true) .done();

Author:
Andre Azzolini (apazzolini)
  • Field Details

    • map

      protected Map<String,Object> map
    • response

      protected jakarta.servlet.http.HttpServletResponse response
  • Constructor Details

    • JsonResponse

      public JsonResponse(jakarta.servlet.http.HttpServletResponse response)
  • Method Details