JSPX 导致复制粘贴代码?
一旦 JSPX 必须是格式良好的 XML,就无法在单独的包含文件中包含包含标签 beginig 的标头部分,因为必须关闭。
看起来您必须始终包含在所有主页中? 或者我错过了什么?
As soon as JSPX must be a well-formed XML, there is no way of having header part including beginig of tag in separate included file, since must be closed.
Looks like you must always include into all of your main pages?
Or do I miss something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Apache Tiles 据说可以解决这个问题,它允许您模板化并重用 JSPX 组件。
更新的答案:
在您的views.xml中,您将具有如下内容:
错误和默认都是我在布局目录中定义的布局,错误是单列布局,默认是两列布局。
布局目录中还有layouts.xml:
我没有亲自手动完成apachetiles集成,我只是使用Spring ROO为我生成一个完整的堆栈,然后根据需要添加/删除内容。
Apache Tiles supposedly solves this problem, it allows you to template and re-use JSPX components.
Updated answer:
In your views.xml, you would have something like the following:
Both error and default are layouts I've defined in the layouts directory, error is a single column layout and default is a two column layout.
Also in the layouts directory is the layouts.xml:
I haven't personally done apache tiles integration by hand, I just use Spring ROO to generate a complete stack for me and then add / remove stuff as I need.