Skip to Content
Jan 27, 2010 at 10:54 AM

Include a JSP inside another JSP



I am stuck with a problem. There is a JSP file available. In this JSP I have to add some more fields. But when I try to ad new fields I am getting a Portal Runtime Error stating that "Code Too Large". So now I thought of putting the new code in another JSP and include that JSP inside my main JSP. Here I cannot use <@include file="..."> because this finally compiles both the JSPs as one.

So I tried to use <JSP:include>. Some one please help me with how to include a JSP inside another using <JSP:include>. Here both the JSPs are having HBJ content inside.

I know that <jsp:include page="relPathOfChild.jsp"/> will include the child.jsp into my main jsp. Problem is both the JSPs are having HBJ content, so If I dont declare <hbj:content> tag inside the child jsp, it is throwing an error. But If I declare a <hbj:content> tag inside my child jsp, only child content is coming and main jsp content is not coming.

Please help me..