I need to make my page inclusion dynamic for the project module that I'm working on... So everything is broken down to a component level. The problem is that my main page, say template.jsp, mapped into the Faces Servlet as *.faces is just a simple page consisting of a number of <jsp:include page= > tags which just bring in a number of *.inc files with jsp content. The rendering works fine till I do a nesting... That is I use a <jsp:include page= > tag in one of the .inc files themselves which calls another JSF. I get an Assertion Failed error. The trace is below. There is no circular reference in the nesting. Could someone plz help me out in this regard....? Thanks in advance.
THIS IS THE EXCEPTION TRACE THAT I GET... exception
There are rules when including JSF pages that need to be followed.
i) The "top level" JSF page must have an <f:view> tag surrounding all JSF tags being used. Since you seem to be mixing and matching simple JSPs and JSF pages I'm not clear if that will always be the case in what you describe
ii) The content of the included JSF (faces) page fragments need to be surrounded with <f:subview> tags. These <f:subview> tags can either be in the included page or surround the include statement in the including page. Either is fine.
iii) All non JSF tags and content in the included JSF (faces) page fragments need to be surrounded by <f:verbatim> tags.
If you're using JSF with a JSP renderer, make sure you're following all of these rules.
If you're building a system with lots of includes and you're using JSF, I'd probably suggest that you consider Facelets. It eliminates requirement (iii) and has expanded support for templating and dynamic inclusion. It does however introduce a few other requirements, most notably that your pages be strict XML. I have been pretty happy with Facelets' features and performance, but your mileage may vary.
Everybody! Do the Funky Monkey! Like this tiny ad!