Class RenderChartController

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.mvc.Controller

    @Controller
    public class RenderChartController
    extends org.springframework.web.servlet.mvc.AbstractController
    Plots data from "statsCollection" bean. The data is converted to XYSeries using SeriesProvider, name of which would be passed as a request parameter. The servlet can only plot up to 9 series. It is customizable using these request parameters:
    • s1c, s2c, ... s9c - Series #i main color
    • s1o, s2o, ... s9o - Series #i outline color
    • bc - Chart background color
    • gc - Chart grid lines color
    • xl - X axis label
    • yl - Y axis label
    • xz - image width
    • yx - image height
    • l - show legend (boolean: true|false)
    • p - name of series provider bean
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static org.slf4j.Logger logger
      The Constant logger.
      private StatsCollection statsCollection
      The stats collection.
      • Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator

        HEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POST
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      StatsCollection getStatsCollection()
      Gets the stats collection.
      org.springframework.web.servlet.ModelAndView handleRequest​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      protected org.springframework.web.servlet.ModelAndView handleRequestInternal​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      void setStatsCollection​(StatsCollection statsCollection)
      Sets the stats collection.
      • Methods inherited from class org.springframework.web.servlet.mvc.AbstractController

        isSynchronizeOnSession, setSynchronizeOnSession
      • Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator

        applyCacheControl, applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isAlwaysMustRevalidate, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, prepareResponse, preventCaching, setAlwaysMustRevalidate, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader, setVaryByRequestHeaders
      • Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport

        getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
      • Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

        getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext
    • Field Detail

      • logger

        private static final org.slf4j.Logger logger
        The Constant logger.
      • statsCollection

        @Inject
        private StatsCollection statsCollection
        The stats collection.
    • Constructor Detail

      • RenderChartController

        public RenderChartController()
    • Method Detail

      • getStatsCollection

        public StatsCollection getStatsCollection()
        Gets the stats collection.
        Returns:
        the stats collection
      • setStatsCollection

        public void setStatsCollection​(StatsCollection statsCollection)
        Sets the stats collection.
        Parameters:
        statsCollection - the new stats collection
      • handleRequest

        @RequestMapping(path="/chart.png")
        public org.springframework.web.servlet.ModelAndView handleRequest​(javax.servlet.http.HttpServletRequest request,
                                                                          javax.servlet.http.HttpServletResponse response)
                                                                   throws Exception
        Specified by:
        handleRequest in interface org.springframework.web.servlet.mvc.Controller
        Overrides:
        handleRequest in class org.springframework.web.servlet.mvc.AbstractController
        Throws:
        Exception
      • handleRequestInternal

        protected org.springframework.web.servlet.ModelAndView handleRequestInternal​(javax.servlet.http.HttpServletRequest request,
                                                                                     javax.servlet.http.HttpServletResponse response)
                                                                              throws Exception
        Specified by:
        handleRequestInternal in class org.springframework.web.servlet.mvc.AbstractController
        Throws:
        Exception