wro4j-使用运行时解决方案构建所有组 [英] wro4j - build all groups using runtime solution

查看:143
本文介绍了wro4j-使用运行时解决方案构建所有组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将wro4j与基于Maven + spring-mvc的Web应用程序一起使用.我有两个不同的wro.properties文件,用于在开发模式与部署模式下对Web应用程序进行不同的配置. wro4j配置为使用运行时解决方案运行.到目前为止,设置工作正常.

I'm using wro4j with a maven + spring-mvc based web application. I have two different wro.properties file to configure the web app differently when in development mode vs deployment mode. wro4j is configured to run using the runtime solution. The setup is working fine so far.

我现在想做的是,在部署模式下,所有wro4j组都应该在服务器启动时立即构建(与每个wro资源的on-first-request相对).我尚未为此找到配置选项-是否有一个?如果没有,我该怎么做呢?

What I want to be able to do now is that in deployment mode, all the wro4j groups should be built immediately on server start up (as opposed to on-first-request per wro resource). I haven't found a configuration option for this - is there one? If not, how can I go about making this happen?

(我知道使用编译模式进行部署可能会得到类似的结果,但是鉴于我已经设置了运行时模式,所以我想知道是否可以承担此费用)

(I know I can probably get similar result using compile mode for deployment, but given that I already have runtime mode set up I am wondering if I can piggy back on that)

推荐答案

一种可行的解决方案是创建自定义 requestHandler ,它将遍历所有组并触发处理.您必须在应用程序启动期间调用该请求处理程序.

A possible solution is to create a custom requestHandler which would iterate through all the groups and would trigger processing. You would have to invoke that request handler during application startup.

如果您想立即使用此功能,请随时打开问题.

If you would like to have this feature out of the box, feel free to open an issue.

这篇关于wro4j-使用运行时解决方案构建所有组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆