Code Monkey home page Code Monkey logo

wro4j-runtime-taglib's Issues

hash not updating when css content changes

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.

recurring no context problem

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>

Feature request: optional domain attribute to tag, or as a configuration parameter

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.

Configure taglib with spring

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.