如何在 contextInitialized() 中获取所有 actionbean 类
这里回答了类似的问题:Stripes 1.5 - 有什么方法可以向系统询问所有 ActionBeans 的列表吗? 它似乎只在 actionbean 代码中起作用,即:当它实际收到请求时。
我想要的是列出 contextListener 代码中的所有 actionbean,例如 contextInitialized() 函数。发生错误:
net.sourceforge.stripes.exception.StripesRuntimeException: Something is trying to access the current Stripes configuration but the current request was never routed through the StripesFilter! As a result the appropriate Configuration object cannot be located. Please take a look at the exact URL in your browser's address bar and ensure that any requests to that URL will be filtered through the StripesFilter according to the filter mappings in your web.xml.
at net.sourceforge.stripes.controller.StripesFilter.getConfiguration(StripesFilter.java:160)
at net.sourceforge.stripes.util.CryptoUtil.encrypt(CryptoUtil.java:123)
我的目的是自动初始化所有后来添加的插件类,而不需要在代码中的某个地方维护所有actionbean 的列表。 有什么建议吗? (或者,至少,是否可以这样做?)
此致,
A similar question is answered here: Stripes 1.5 - any way to ask the system for a list of all ActionBeans? it seems only work in an actionbean code, i.e: when it actually receives a request.
What I want is to list all actionbeans in contextListener code, for instance contextInitialized() function. Error happened:
net.sourceforge.stripes.exception.StripesRuntimeException: Something is trying to access the current Stripes configuration but the current request was never routed through the StripesFilter! As a result the appropriate Configuration object cannot be located. Please take a look at the exact URL in your browser's address bar and ensure that any requests to that URL will be filtered through the StripesFilter according to the filter mappings in your web.xml.
at net.sourceforge.stripes.controller.StripesFilter.getConfiguration(StripesFilter.java:160)
at net.sourceforge.stripes.util.CryptoUtil.encrypt(CryptoUtil.java:123)
My purpose is to automatically initialize all the plug-in classes added later, without maintaining a list of all actionbeans somewhere in the code.
Any suggestion? (or, at least, is it possible to do so?)
Best Regards,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的。一段时间后,我找到了解决方案:使用 Stripes ResolverUtil
谢谢!
OK. After a while, I figured out the solution: using Stripes ResolverUtil
Thanks!