Monthly Archives: April 2015

Use CDN Service in Spring MVC

A few days ago, I created TestZilla on Aliyun Elastic Compute Service. However, with the increment of PV, I decided to use CDN to cache static files(images, CSS, and javascript). But there's no information on how to use CDN with Spring MVC, so I asked a question on StackOverflow. Setup Spring Configuration First of all, you need to use PropertyPlaceholderConfigurer in Spring Configuration(such as dispatcher-servlet.xml) Of course, you need to add XML Namespaces: Create Properties File As I was declared in the Spring configuration, there is a file named testzilla.properties in the classpath.You need to create the file and add the following lines to it:[plain]cdn.url=//cdn.testzilla.org/[/plain] Of course, you can add extra properties if needed: Use CDN Property in JSP Now, we…

Continue Reading
Contact Us
  • Nanyang Technological University, Singapore
  • root [at] haozhexie [dot] com