Resource Server is a collection of libraries and a web application geared towards more efficient inclusion of static resources such as CSS and JavaScript in Java web applications.
Switch branches/tags
resource-server-parent-1.0.24 resource-server-parent-1.0.23 resource-server-parent-1.0.22 resource-server-parent-1.0.21 resource-server-parent-1.0.18 resource-server-parent-1.0.17 resource-server-parent-1.0.16 resource-server-parent-1.0.13 resource-server-parent-1.0.12 resource-server-parent-1.0.10 resource-server-parent-1.0.4@20392 resource-server-parent-1.0.4@18470 resource-server-parent-1.0.4 resource-server-1.3.0 resource-server-1.2.0 resource-server-1.1.1 resource-server-1.1.0 resource-server-1.0.48 resource-server-1.0.47 resource-server-1.0.46 resource-server-1.0.45 resource-server-1.0.44 resource-server-1.0.43 resource-server-1.0.42 resource-server-1.0.41 resource-server-1.0.40 resource-server-1.0.39 resource-server-1.0.38 resource-server-1.0.37 resource-server-1.0.36 resource-server-1.0.35 resource-server-1.0.35-M1 resource-server-1.0.34 resource-server-1.0.34-M3 resource-server-1.0.34-M2 resource-server-1.0.34-M1 resource-server-1.0.33 resource-server-1.0.32 resource-server-1.0.31 resource-server-1.0.30 resource-server-1.0.29 resource-server-1.0.28 resource-server-1.0.27 resource-server-1.0.25 resource-server-1.0.20 resource-server-1.0.19 resource-server-1.0.11 resource-server-1.0.9 resource-server-1.0.8 rel-1.0.15 rel-1.0.14 rel-1.0.7@20392 rel-1.0.7@19500 rel-1.0.7 rel-1.0.6@20392 rel-1.0.6@19500 rel-1.0.6 rel-1.0.5@20392 rel-1.0.5@18979 rel-1.0.5 rel-1.0.3@20392 rel-1.0.3@18430 rel-1.0.3 rel-1.0.2@20392 rel-1.0.2@18357 rel-1.0.2 rel-1.0.1@20392 rel-1.0.1@18319 rel-1.0.1 rel-1.0.0@20392 rel-1.0.0@18315 rel-1.0.0 rel-1.0.0-RC2@20392 rel-1.0.0-RC2@17348 rel-1.0.0-RC2 rel-1.0.0-RC1@20392 rel-1.0.0-RC1@17345 rel-1.0.0-RC1@17069 rel-1.0.0-RC1
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Resource Server

Maven Central Linux Build Status Windows Build status


The Resource Server is a collection of libraries and a web application geared towards more efficient inclusion of static resources such as CSS and JavaScript in Java web applications. Shared resources such as jQuery releases are included in the web application under a well defined, versioned URL with browser-side caching headers and gzip compression applied. A Maven plugin provides for JS and CSS minification and aggregation, combining many small files into a single uniquely named file to allow for browser-side caching. JSP tags allow for easy, automatic use of these aggregated files and files from the Resource Server web application when it is available and fail gracefully when it is not.

The end goal of these utilities is to reduce the number of distinct resource URLs the browser has to retrieve content from for any given page and to take advantage of browser side caching to reduce the number of requests the browser has to make.

Using the Resource Server

The resource server is made of of four main components.

Resource Server Web Application

The web application deployed with uPortal since the 3.1 release which provides:

  1. Well defined, versioned URLs for static resources such as JavaScript libraries.
  2. Setting aggressive browser-side caching headers for static resources.
  3. Providing server-side gzip compression of static resources.
  4. Providing a single URL for a resource that may be used by multiple web applications.
  5. Fall back gracefully to local static resources if the Resource Server is not available.
  6. Provide functionality general enough to be interesting to any Java servlet or portlet application.

Resource Server Maven Plugin

A Maven plugin which aggregates and compresses JavaScript and CSS into a minimal set of files with unique file names to allow for aggressive browser-side caching.

Resource Server Utilities

Utility library used by various components for common functionality

  1. Provide a utility class which does:
    • Load lists of both aggregated and un-aggregated CSS/JS files for a web application from the resources XML file.
    • Determine if resource aggregation is enabled or disabled based on a system property.
    • Determine if the Resource Server Web Application is deployed and if it is if the requested resource is available from it.
  2. Provide aggregation aware JSP tags to
    • Write out the CSS/JS link and script tags from the list of resources loaded by the utility class.
    • Generate a resource URL based on if it is available from the Resource Server Web Application.
    • Minify in-line JavaScript
  3. Provide aggregation aware servlet filters to
    • GZip and cache in memory static resources
    • Set long-term browser-side caching headers for static resources based on the path of the resource

Resource Server Content

WAR packaged artifact that contains all of the static content available from the Resource Server Web Application. Used with Maven WAR Overlay support to include the resources used by the web application locally so that fall-back works correctly if the Resource Server Web Application is not available.