jsp:include page - Error - javax.servlet.jsp.JspException: Assertion Failed

Here are rules when including JSF pages that need to be followed.


i) The "top level" JSF page must have an 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 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.

0 comments: