spring ioc 和 JSR168 Portlet

发布于 2024-08-04 23:21:52 字数 46 浏览 2 评论 0原文

是否可以使用 spring 将依赖项注入到 jsr168 Portlet 中?

Is it possible to do dependency injection using spring into a jsr168 Portlet?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

居里长安 2024-08-11 23:21:52

是的 - 请查看 portlet 章节弹簧参考。

请注意,您需要实现 特殊 Spring portlet控制器 接口,而不是标准 portlet。这些控制器以及注入的 bean 应该位于 contextConfigLocation 参数中指定的 spring 上下文文件中。我想通常的 applicationContext.xml 也可以工作(如果你注册了 spring servlet 上下文监听器)

Yes - have a look at the portlet chapter in the spring reference.

Notice that you need to implement the special spring portlet controller interface, and not the standard portlet. These controller as well as the injected beans should be in the spring context file specified in the contextConfigLocation parameter. I guess that the usual applicationContext.xml will work as well (if you register the spring servlet context listener)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文