Comments (11)
I'm not sure that I understand but it seems to me that built-in wro4j model interpolation might be exactly what you are looking for.
from wro4j-runtime-taglib.
That one would allow me to prefix included resources in a group to load them from different places, but what I need is to have output from the Script/StylesheetTag like
<script src='//keycdn-14576.keycdn.com/resources/core-52b380f59cd70730bccbf2da93a87595.js'>
</script>
if I use the script tag like
<c:set var="cdn" value="//keycdn-14576.keycdn.com" />
<!-- spring profile dependent -->
<wro:script group="core" prefix="${cdn}" />
from wro4j-runtime-taglib.
Does it make sense to make it application-wide or you need a more fine-grained control over your resources?
e.g. I might support something like
resourceDomain=//keycdn-14576.keycdn.com
in wro.properties. This would affect all resources though
from wro4j-runtime-taglib.
This would be sufficient in my case, since we load all css/js resources from the cdn.
from wro4j-runtime-taglib.
Alright, changes are on resourceDomain branch. Tests are green but I didn't have a chance to test it on actual CDN so I would keep it there for a while.
from wro4j-runtime-taglib.
Ok, it works well, if configured in the wro.properties file. However, when configuring through spring, wro.properties might be loaded from elsewhere, eg. if using a different wro.properties file depending on the deployment profile.
See eg. https://groups.google.com/forum/#!msg/wro4j/GUQ9zmDDVbw/E0VzlrC7dEUJ
I'm not sure what's the best approach here. Would it be possible to retrieve the configuration properties from the wroManagerFactory?
from wro4j-runtime-taglib.
You might override ConfigurableWroManagerFactory#newConfigProperties.
e.g. you may store common properties in wro.properties and put all environment-specific properties in wro-{environment}.properties. Then you might load them based on current spring environment profile
from wro4j-runtime-taglib.
True, but I still can't override resourceDomain only for the production environment, since it's loaded using ServletContextPropertyWroConfigurationFactory which fetches the wro.properties file from a hardcoded location.
from wro4j-runtime-taglib.
Right, I forgot that there is no such thing as single source of properties in wro4j.
I should probably introduce something like Wro4jManagerFactory to taglib.
In the mean time, you might fallback to something like this.
from wro4j-runtime-taglib.
Ok, I might use a workaround for now. The current setup I've got is pretty good at the moment.
from wro4j-runtime-taglib.
Closing this one for now as I'm going to include current implementation in 0.2.0 release. Feel free to reopen it
from wro4j-runtime-taglib.
Related Issues (9)
- Add Maven Central badge to README HOT 1
- Configure taglib with spring HOT 10
- Initialisation fails when WroFilter is not of type ro.isdc.wro.http.WroFilter HOT 1
- recurring no context problem HOT 3
- Could TaglibContext be made non-final? HOT 5
- Track code coverage with codecov
- Update dependencies for 0.2.0 release HOT 1
- hash not updating when css content changes HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wro4j-runtime-taglib.