且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

JSP/Spring MVC和CDN?

更新时间:2023-11-17 23:31:10

您可以使用属性"文件来管理URL和其他属性.在jsp中,您可以引用该文件中的属性.

You can manage your URLs and other properties using Properties file. In the jsp, you can refer the properties from that file.

基本上,您可以具有两个特定于您的环境的属性文件.当您在本地时,请使用本地属性文件,该文件将指向您的本地资源.如果您指向实时网站,请使用包含CDN网址的其他属性.在属性之间进行切换的工作是部署的一部分.

Basically you can have two properties files specific to your environment. When you are in local, use local properties file that will point to your local resources. If you point to live website, use the other properties that contains CDN urls. The effort to switch between properties is as part of your deployment.