wro4j / wro4j-runtime-taglib Goto Github PK
View Code? Open in Web Editor NEWThis is a tag library that provides additional features to wro4j run-time solution.
This is a tag library that provides additional features to wro4j run-time solution.
It would make it easier to change the initialisation if this class could be subclassed. Would imply making the constructor public as well.
I'm not sure if it's an error in my configuration, or a bug, but it seems that a webapp restart is required for the hash of a group to update.
Eg. I can update a less file, and see it's content change when i reload the resulting css for that particular group, using the same resource name / hash. If I restart the webapp, then I get an exception, eg.
ro.isdc.wro.WroRuntimeException: No such group available in the model: external-d3a9f9523f74c740f8a9daaa03412331
I didn't realize this until I got my cache headers set up properly, so I didn't see that the group hash didn't change when the content changed until now. Here's my current configuration;
gzipResources=true
minimizeEnabled=true
ignoreMissingResources=false
jmxEnabled=true
hashStrategy=MD5
namingStrategy=hashEncoder
cacheUpdatePeriod=18000
modelUpdatePeriod=18000
optimizedResourcesRootStrategy=predefined
optimizedResourcesRoot=/resources/wro/
preProcessors=less4j,cssUrlRewriting,lessCssImport,semicolonAppender
postProcessors=cssMinJawr,jsMin
uriLocators=servletContext,uri,classpath
I've tried both the master branch and the resourceDomain branch.
I sporadically get these, am thinking it might be a timing issue, since a page reload often results in a properly rendered page;
ro.isdc.wro.WroRuntimeException: No context associated with CURRENT request cycle!
at ro.isdc.wro.config.Context.validateContext(Context.java:124)
at ro.isdc.wro.config.Context.get(Context.java:107)
at ro.isdc.wro.model.group.processor.InjectorBuilder$17.create(InjectorBuilder.java:254)
at ro.isdc.wro.model.group.processor.InjectorBuilder$17.create(InjectorBuilder.java:252)
at ro.isdc.wro.util.ProxyFactory$1.invoke(ProxyFactory.java:70)
at com.sun.proxy.$Proxy356.getConfig(Unknown Source)
at ro.isdc.wro.cache.support.DefaultSynchronizedCacheStrategyDecorator.getResourceWatcherUpdatePeriod(DefaultSynchronizedCacheStrategyDecorator.java:109)
at ro.isdc.wro.cache.support.DefaultSynchronizedCacheStrategyDecorator.shouldWatchForChange(DefaultSynchronizedCacheStrategyDecorator.java:154)
at ro.isdc.wro.cache.support.DefaultSynchronizedCacheStrategyDecorator.onBeforeGet(DefaultSynchronizedCacheStrategyDecorator.java:142)
at ro.isdc.wro.cache.support.DefaultSynchronizedCacheStrategyDecorator.onBeforeGet(DefaultSynchronizedCacheStrategyDecorator.java:35)
at ro.isdc.wro.cache.support.AbstractSynchronizedCacheStrategyDecorator.get(AbstractSynchronizedCacheStrategyDecorator.java:40)
at com.github.lifus.wro4j_runtime_taglib.model.group.name.DefaultVersionedGroupNameFactory.getInputStream(DefaultVersionedGroupNameFactory.java:58)
at com.github.lifus.wro4j_runtime_taglib.model.group.name.DefaultVersionedGroupNameFactory.create(DefaultVersionedGroupNameFactory.java:40)
at com.github.lifus.wro4j_runtime_taglib.model.resource.uri.strategy.VersionedResourceUriStrategy.getPathRelativeToWroRoot(VersionedResourceUriStrategy.java:62)
at com.github.lifus.wro4j_runtime_taglib.model.resource.uri.strategy.VersionedResourceUriStrategy.getUriOfOptimizedResource(VersionedResourceUriStrategy.java:49)
at com.github.lifus.wro4j_runtime_taglib.model.resource.uri.strategy.VersionedResourceUriStrategy.getResourcesUris(VersionedResourceUriStrategy.java:45)
at com.github.lifus.wro4j_runtime_taglib.model.resource.uri.strategy.ConfigurableResourceUriStrategy.getResourcesUris(ConfigurableResourceUriStrategy.java:110)
at com.github.lifus.wro4j_runtime_taglib.model.resource.uri.cache.ResourceUriCacheStrategyDecorator.loadValue(ResourceUriCacheStrategyDecorator.java:38)
at com.github.lifus.wro4j_runtime_taglib.model.resource.uri.cache.ResourceUriCacheStrategyDecorator.loadValue(ResourceUriCacheStrategyDecorator.java:17)
at ro.isdc.wro.cache.support.AbstractSynchronizedCacheStrategyDecorator.get(AbstractSynchronizedCacheStrategyDecorator.java:55)
at com.github.lifus.wro4j_runtime_taglib.context.TaglibContext.getResourceUris(TaglibContext.java:64)
at com.github.lifus.wro4j_runtime_taglib.tag.AbstractWroElementTag.getResourceUris(AbstractWroElementTag.java:50)
at com.github.lifus.wro4j_runtime_taglib.tag.AbstractWroElementTag.getOutput(AbstractWroElementTag.java:42)
at com.github.lifus.wro4j_runtime_taglib.tag.AbstractHtmlElementTag.doTag(AbstractHtmlElementTag.java:23)
My filter mapping order is the following;
<filter-mapping>
<filter-name>WroContextFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>ERROR</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>isUserInRoleFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>WroFilter</filter-name>
<url-pattern>/resources/wro/*</url-pattern>
<url-pattern>/admin/wro/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>siteMeshFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>httpMethodFilter</filter-name>
<servlet-name>appServlet</servlet-name>
</filter-mapping>
<filter-mapping>
<filter-name>sessionRegisterFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>pageViewCounter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
We use a CDN for our production environment, so I add a hostname prefix to resources for the production Spring environment profile. I think an optional hostname could either be added as an attribute to the script and style taglib, or through the wro.properties file.
Alternatively, there could be a third tag that merely provides the path / url to the resource with the correct fingeprint, if needed eg for use in Javascript. The CDN hostname could then be prefixed manually.
wro4j:1.7.8
powermock:1.6.2
maven-compiler-plugin:3.3
maven-release-plugin:2.5.2
maven-javadoc-plugin:2.10.3
maven-gpg-plugin:1.6
It would be very convenient if the taglib could be configured through Spring. This is especially handy when the wro4j filter and manager is itself configured through Spring.
Initialisation fails with error ...WroFilter is not registered in web.xml, if the WroFilter is not strictly an instance of ro.isdc.wro.http.WroFilter, eg instead being an instance of ro.isdc.wro.http.ConfigurableWroFilter.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.