参数化 portlet 并从虚拟机端访问这些参数

发布于 2024-11-28 00:41:07 字数 270 浏览 3 评论 0原文

我有 portlet,我想通过一些静态属性将它们分成两组。我所说的静态是指该属性对于所有实例都是相同的(因此,据我所知,它与 portlet 配置不同 - 很有可能,我错了)。

那么,在基于 liferay vm 的主题中区分此 portlet 的最佳方法是什么? 在我的脑海中,我可以想象我正在放置一个可以从 servlet 上下文访问的属性文件。这个解决方案让我感到害怕(在每个请求上读取文件?!!),此外,我不知道如何从速度模板访问 servlet 上下文。

我将不胜感激任何谦虚的帮助。

I have portlets, and I want to separate them on two groups by some static property. By static I mean this property is the same for all instances (so, it is not the same like portlet configuration as far as I understand it - quite possible, I'm wrong).

So, what is the best way to differ this portlets in liferay vm-based theme?
Off the top of my head, I can imagine that I'm putting a properties file which I can access from servlet context. This solution is terrifying me (reading file on each request?!!), besides, I don't know how I exactly can access servlet context from velocity template.

I would appreciate any help with humility.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文