How to include a jsp using a JSP tag

28836, modified 19 Years ago. New Member Posts: 4 Join Date: 1/26/07 Recent Posts
Hi,

I am having problems when I try to include a JSF portlet inside another portlet using either jsp:include or pageContext.include.

<%@include file="policySelection.jsp"%> but the following does not work

<include page="poilcySelection.jsp"/> or if I use
pageContext.incldue("policySelection.jsp") inside the jsp tag handler. Note that policySelection.jsp is a jsf page.

Please Suggest
thumbnail
24856, modified 19 Years ago. Regular Member Posts: 155 Join Date: 8/9/06 Recent Posts
hi,

Did you try with

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


it is working for me.

Regards,
Abhijit Gurav
30346, modified 19 Years ago. New Member Posts: 6 Join Date: 3/13/07 Recent Posts
Hi,

You need to put &lt;jsp:include page="jspPageToInclude.jsp"/&gt; in &lt;/f:subview&gt; tag.

&lt;f:view&gt;
&lt;f:subview id="subpage"&gt;
&lt;jsp:include page="jspPageToInclude.jsp"/&gt;
&lt;/f:subview&gt;
&lt;/f:view&gt;

or you can also use JSTL &lt;c:import&gt;

Note:-

all JSF component custom actions in included pages must be nested inside the <f:subview> custom action from the JSF Core Tag Library (which is itself nested inside the <f:view> custom action). The <f:subview> action itself may be present in the including page (i.e. with the <jsp:include> or <c:import> action nested inside it), or in the included page.


Cheers!
Team Cignex