Results 1 to 2 of 2

Thread: No CDN during dev; CDN in prod

  1. #1
    Join Date
    Sep 2006
    Location
    Hartford, CT
    Posts
    145

    Default No CDN during dev; CDN in prod

    Hi all,

    This is not necessarily a Spring question per se, but I have a feeling that either Spring has a trick up its sleeve that I haven't learned yet, or else the Spring community has a trick up its sleeve...

    Throughout my application, anywhere that I reference static content, I'm in the habit of using JSTL's <c:url/> tag.

    I'm now interested, however, in using a content distribution network- but I don't want to use that when I'm working locally. So basically, during development, I want static content resolved from within my workspace the way it is today, but when deploying to production, I'd like to use my CDN (which is on a different domain).

    Anybody have any nice tricks?

    Note, I did see there is a Spring <s:url/> tag similar to JSTLs and it has a context attribute that "Specifies a remote application context path. The default is the current application context path." But I haven not seen a practical example of how this might solve the problem.

    Any help is appreciated!

    EDIT: I should add that it's obviously a pretty light lift to write my own URL tag that can accomodate this, but if there's an existing, common solution to this problem, I have a strong preference for using that instead.
    Last edited by krancour; Jun 27th, 2012 at 11:58 AM.
    Kent Rancourt
    DevOps Engineer

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    There is nothing like an URL tag which might help you. One thing that might help is the use of Themes, you could have a theme for dev and one for prod. Then define the URLs in a property file and have the spring theme tag take care of things. But that is more or less a work-around.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •