- Run-time support for namingStrategy configuration option.
- Configurable rendering of resource URIs. Provides resourceUriStrategy configuration option.
- Allows for rendering of external and protected unprocessed resources.
- Legacy code friendly. Tag library allows direct access to optimized resources.
- Wrapper-based implementation. Tag library shouldn't affect your wro4j customizations.
- Lazy-loading. Defer initialization of data until it's first required.
- Separate tag library context for web applications. Tag library stores it's data in servlet context scope.
- Exhausted caching of tag library data. Creates cache using cachingStrategy.
- Adaptable to resource changes. Supports resourceWatcherUpdatePeriod.
-
Java 7 or higher.
-
Java Servlet 3.0 Container, or newer.
-
Wro4j 1.7.x.
<listener>
<listener-class>ro.isdc.wro.http.WroServletContextListener</listener-class>
</listener>
<filter>
<filter-name>WroContextFilter</filter-name>
<filter-class>ro.isdc.wro.http.WroContextFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>WroContextFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
- Add ContextListener to web.xml after WroServletContextListener
<listener>
<listener-class>com.github.lifus.wro4j_runtime_taglib.servlet.TaglibServletContextListener</listener-class>
</listener>
- include the following tag library directive in every JSP in which optimized resources are used
<%@ taglib prefix="wro" uri="https://github.com/lifus/wro4j-runtime-taglib"%>
- Replace usages of optimized resources with tags
<wro:script group="all" />
<wro:stylesheet group="all" />
Use wro.properties.
Default: versioned.
Resources that should be rendered. Specify one of the following values:
Value | Description |
---|---|
versioned | Render optimized resources and version their URIs |
unoptimized | Render unprocessed resources. Supported uriLocators are servletContext and uri. |
Default: inferred.
Strategy to find the root of optimized resources. Specify one of the following values:
Value | |
---|---|
inferred | Use value of the first url-pattern for the first WroFilter in web.xml |
predefined | Use value of optimizedResourcesRoot property in wro.properties |
The root of optimized resources. Required when optimizedResourcesRootStrategy
is predefined
, ignored when optimizedResourcesRootStrategy
is inferred
.
Example: optimizedResourcesRoot=/wro/
The domain that is used to serve resources to your users.
Example: resourceDomain=//your-cdn.com
This project is available under the Apache License, Version 2.0.