如何在后端解析 Seam URL?
我们已经得到了许多页面中的第一个,这些页面将不是由 Seam 而是由 FreeMarker 生成。 FreeMarker 无法处理
我希望能够做的是处理从后端表示为 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这很难。您正在寻找的逻辑在几个类中是稀疏的,并且从
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 thegetUrl()
method of this class.Hope this helps.