Search code examples
jakarta-eewebdeploymentwebsphereibm-rad

Place CSS and Javascript outside EAR


I have a web application deployed in IBM websphere. Each time I change my css or javascript file I have to redeploy EAR file. Is it possible to place these css/javascript files outside EAR/WAR file so that I can avoid redeploying EAR file.


Solution

  • For that pattern, I recommend placing those static files in a different location on your web server (or proxy server if you have one), then referencing them from your pages with a path Alias. For instance in Apache/IHS:

    Alias /css /usr/IBM/HTTPServer/htdocs/css
    

    And then in your HTML/JSP:

    <link rel="stylesheet" href="/css/styles.css" type="text/css" media="screen">