如何使JSF不止一个JSP页面到1单一视图? [英] How does JSF render more than one JSP pages into 1 single view?

查看:146
本文介绍了如何使JSF不止一个JSP页面到1单一视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我所在的WebContent文件夹有许多的.jsp navigation.jsp,primarytabs.jsp 等。

I have an application where the WebContent folder has a number of .jsp pages like navigation.jsp, primarytabs.jsp etc.

navigation.jsp 包含一个垂直菜单和 primarytabs.jsp 包含在顶部的标签,有的其他JSP中包含的各个组件。

The navigation.jsp contains a vertical menu and the primarytabs.jsp contains a tab on top, and some other jsps contain individual components.

当我运行应用程序服务器的应用程序,它开辟了一个欢迎页面,而所有这些导航项目,标签和其他合并成一个单一的视图,并告诉我们所有这些组件的结构良好的结合。

When I run the application of the application server, it opens up a welcome page, and all these navigation items, and tabs and others merge into a single view and show us a well formed combination of all these components.

我做了一些研究和阅读有关的复合意见。但我不知道我是否可以把这种复合视图与否。

I did some studying and read about "composite views". But I wasn't sure if I can call this composite view or not.

您可以请赐教关于JSF如何将所有这些JSP到一个视图中,并在那里找到了绑定的code之内,所以我可以作出相应的修改?

Can you please enlighten me about how JSF combines all these jsps into one view and where to find that "binding" within the code so I can make the relevant changes?

非常感谢你。

更多细节:

非常感谢你的答案。我已经通过code过去了,已经看到了

Thank you very much for the answers. I have gone through the code and have seen

src="<%= request.getContextPath() %> /faces/tabs.jsp 
src="<%= request.getContextPath() %> /faces/navigator.jsp

和等。我presume这些执行你在上面用include标签描述的类似的功能?

and so on. I presume these perform the similar function that you have described above with the include tag?

推荐答案

您欢迎页面可能是这个样子:

You welcome page might look something like this:

Welcome.jsp中:

Welcome.jsp:

<jsp:include page="/include/header.jsp" />
<jsp:include page="/include/navigation.jsp" />

<!-- Content of Page -->

<jsp:include page="/include/footer.jsp" />

想Welcome.jsp中是一个冰箱和包括当磁体是在页面上。

Think of Welcome.jsp being a refrigerator and the includes being magnets that are on the page.

如果你想改变的东西 header.jsp中,将改变每个页面上它是包含在,模板在感。

If you would like to change something in the header.jsp that would change on every page it is included on, templating in a sense.

这篇关于如何使JSF不止一个JSP页面到1单一视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆