• Post Reply Bookmark Topic Watch Topic
  • New Topic

Newbie Question: How does JSF render more than one JSP pages into 1 single view?

 
Ron Ciencia
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, I'm new to code ranch and I love how it works. And here's the issue I have today:

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

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.

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?

Thank you very much.
 
Luan Cestari
Ranch Hand
Posts: 172
C++ Redhat Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it isnt in the welcome page content, this page probably use a JSF template which includes each of those JSP pages. Try to use your IDEA to find any "include" or the JSP file name in the project to figure out which method the developer chose.
 
Ron Ciencia
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
src="<%= request.getContextPath() %> /faces/tabs.jsp

Thanks for the answer. Withinn the code there are above statements which point to different components in the page. Think these are the ones binding it to the view.
Cheers
 
Tim Holloway
Bartender
Posts: 18412
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSF2 does not use "JSPs". That was a characteristic of JSF version 1 and has been obsolete for a long time now. JSF2 uses View Template (xhtml) files.

The "JSPs" in JSF really never were true JSPs, even in JSF1. Except maybe back when JSF was still in the experimental stages.

You cannot include multiple "JSPs" in a JSF page. JSF constructs the page as a single web page and the closes thing to actual multiple JSPs would be an HTML FRAME, which doesn't work very well in JSF.

On the other hand, you can pull together multiple View Template fragments to form a standardized page, using a process called "tiling". Like a tile mosaic, each fragment forms part of the web page that will be rendered and displayed. This is extremely common.

The tiling process is done by using the Facelets tags, which define what gets included into the finished page.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!