在Grails中指定插件的顺序 [英] Specifying order of plugins in Grails

查看:84
本文介绍了在Grails中指定插件的顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的grails应用程序依赖于几个grails插件,它们追加并输入到web.xml。

问题是我需要控制插件的执行顺序。有一个特定的插件用于某些安全目的,它在web.xml中添加了一个过滤器。此过滤器需要是web.xml中第一个执行的过滤器因此,我希望最后执行此过滤器,以便我可以确保此插件将在第一个位置追加配置。



我知道plugin类有一个dependsOn属性来确保它最后被执行,但只有当我知道哪些插件将与此插件结合使用时才有效。我希望这个插件足够通用,这样我公司的任何人都可以使用这个插件,并确信这个插件最后得到执行。



有什么方法可以确保最后一个特定的插件被执行?无论是在grails-plugin项目(即插件类的属性)或grails应用程序项目的配置。

谢谢,

解决方案

找到一种方法可以更容易地让你的插件追加不同的过滤器,以确保它们被追加到你想要的位置。我必须看到这个插件的代码,如果我试图以这种方式帮助解决这个问题的话。


My grails application depends on several grails plugins that append and entries to web.xml

The problem is I need to control the order the plugins are executed. There is a particular plugin which is used for some security purposes which adds a filter in web.xml. This filter needs to be the first executed filter in web.xml Thus I would like this filter to be executed last so that I can ensure that this plugin will be appending the configurations in the first position.

I know there is a dependsOn property on the plugin class to ensure it gets executed last, but that only works if I know which plugins are going to be used in combination with this plugin. I would like this plugin to be general enough so that anyone in my company can use this plugin and know for sure that this gets executed last.

Is there any way I can ensure a particular plugin gets executed last? Either in the grails-plugin project (ie a property of the plugin class) or configuration of the grails application project.

Thanks,

解决方案

It might be easier to find a way to make your plugin append it's filters differently to ensure they get appended to the position you want them in. I would have to see the code for the plugin if I was going to try to help solve this in that way though.

这篇关于在Grails中指定插件的顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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