【问题标题】:How to control package structure with seam-gen如何使用 seam-gen 控制包装结构
【发布时间】:2011-02-09 17:57:40
【问题描述】:

我一直通过使用 seam-gen 生成并从那里进行调整来添加到现有应用程序。我一直遇到的一个问题是我必须花费大量时间编辑 xhtml 文件以反映包结构。

例如,seam-gen 认为这会起作用

   <s:decorate id="simplePidField" template="layout/edit.xhtml">

因此在每个 .xhtml 中,我们必须将其更改为

   <s:decorate id="simplePidField" template="/layout/edit.xhtml">

出现这种和其他不一致的原因是 seam-gen 在一个位置构建了一个包含所有 xhtml 文件的平面目录,而我们的应用程序将这些文件划分和细分为多个目录。

有没有办法,在reveng.xml文件中定义一个包结构?
谢谢。

【问题讨论】:

    标签: seam seam-gen


    【解决方案1】:

    不,不在 reveng.xml 文件中。您必须查看 seam-gen 源代码中的 freemarker 代码并在那里进行调整。

    看看

    seam-src/seam-gen/view/editproperty.xhtml.ftl 
    

    归档并定位

    &lt;s:decorate id="${componentProperty.name}Field" template="layout/edit.xhtml"&gt;'

    &lt;s:decorate id="${property.name}Field" template="layout/edit.xhtml"&gt;'

    并分别更改它们。


    否则,您只需在视图文件夹中使用搜索/替换功能。这可能更容易

    【讨论】:

    • 谢谢!这对布局部分起到了作用。我将在此处注意,我也更改了 view.xhtml.ftl 中的路径,因此它在每个 xhtml 文件开头的 ui:composition 标记中修复了 template.xhtml 的路径。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多