如何在后端解析 Seam URL?

发布于 2024-11-07 17:31:56 字数 423 浏览 3 评论 0原文

我们已经得到了许多页面中的第一个,这些页面将不是由 Seam 而是由 FreeMarker 生成。 FreeMarker 无法处理。但是我们需要在页面内有链接到同一应用程序内的 Seam 页面的链接。

我希望能够做的是处理从后端表示为 s:link's view="/something.xhtml" 或 action="#{testClass.test}" 的内容,以便我可以获取 URL ,将其放入 FreeMarker 的哈希中,FreeMarker 可以像任何其他文本一样将其插入页面中。

问题是,我该怎么做?我将使用哪些 Seam 函数来进行该转换?

或者,如果您的答案是“愚蠢地阅读源代码”,请告诉我应该在哪里寻找为标签提供支持的源代码。我自己也想到了这一点,但由于我对 Seam、JSF 等不熟悉,我一直无法弄清楚我应该在哪里寻找。

We've got the first of many pages that are going to be generated not by Seam but by FreeMarker. FreeMarker has no way to process an <s:link> but we need to have links within the page that link over to Seam pages within the same application.

What I would like to be able to do is process what would be expressed as the s:link's view="/something.xhtml" or action="#{testClass.test}" from the back end so I could get a URL out, put it into the hash for FreeMarker, and FreeMarker can just insert it into the page just like any other text.

The question is, how do I do that? What Seam functions would I use to do that conversion?

Alternatively, if your answer is, "read the source stupid," please tell me where I should be looking for the source that powers the tag. I thought of that myself but due to my unfamiliarity with Seam, JSF, etc. I haven't been able to figure out where I should be looking.

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

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

发布评论

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

评论(1

黑寡妇 2024-11-14 17:31:56

我认为这很难。您正在寻找的逻辑在几个类中是稀疏的,并且从 s:link 生成的最终 html 取决于整个 JSF 渲染响应阶段发生的情况。

定义如何呈现操作和视图属性的大部分代码位于 org.jboss.seam.ui.component.UISeamCommandBase 中。我建议您开始在此类的 getUrl() 方法中放置一些断点。

希望这有帮助。

This is quite hard, I think. The logic you are looking for is sparse in several classes and the final html that comes out from s:link depends on what happens during the entire JSF render response phase.

Most of the code that defines how action and view attributes are rendered is in org.jboss.seam.ui.component.UISeamCommandBase. I suggest that you start putting some breakpoint in the getUrl() method of this class.

Hope this helps.

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