I verified that calling this method programmatically works great, so it should work fine if I invoke it from the XML right? But I am trying to do the same, as shown below, but this does not work for me, and I get zero entries added to the final map. paths) of WebContentInterceptor which will add entries to the map cacheControlMappings. ![]() ![]() Then I wish to invoke this method - public void addCacheMapping(CacheControl cacheControl, String. I am creating a CacheControl bean as follows, and I verified by debugging that this bean gets created successfully with appropriate values populated in the application context. My configuration in spring-mvc-config.xml is as follows. ![]() ![]() As a workaround, I am invoking the addCacheMapping method using the .config.MethodInvokingBean. I am trying to set the map property cacheControlMappings of .mvc.WebContentInterceptor, but the only problem is the design of the class which has no setter method for the property. I want to add cache-control directive (set both public and max-age seconds) for a couple of URLs in Spring MVC and I want to do those changes via applicationContext.xml only.
0 Comments
Leave a Reply. |