I looked into the code of the PortalDriverServlet and figure out a workaround. I am not sure if it is the correct way or not, but it works.

 

Use the following code in the jsp page.

 

<%@ page import="org.apache.pluto.driver.url.PortalURL" %>

 

<% PortalURL portalUrl = new PortalURL("http://", "localhost", 8080, "/pluto", "/portal") ;

   portalUrl.setRenderPath("Secondary Page");

   request.setAttribute(PortalURL.class.getName(),portalUrl); %>

 

<jsp:include page="/portal/Secondary Page" /> <!--  page attribute can be /portal/anything as the info is pulled out from the PortalURL -->

 

The question still remains that why U need to create a PortalURL and set it as an attribute in the request and do an include while all the information is present in the servletRequest and the page attribute of the include?

 


From: Bhupesh Reddy Sura
Sent: Wednesday, August 23, 2006 7:52 PM
To: '[EMAIL PROTECTED]'; '[email protected]'
Subject: How to Include a Portal Page/Portlet in a JSP page

 

 

Hi,

 

I am relatively new to Pluto. What I am trying to do is to include a portal page in a jsp page.

 

So I have created a abc.jsp under pluot-portal.war file  which contains the code

 

 <jsp:include page=”/portal/Pluto%20Admin” />

 

My intension is to display the page containing the Pluto Admin portlet.

 

But I access the jsp say http://localhost:8080/pluto/abc.jsp , It is displaying me the Test Portlet Page.

 

When I look at the stack trace, It shows that the Requested Page is null and therefore it is showing the default Test Portlet page.

 

 

[DEBUG] PortalURLParser - Parsing URL: /pluto/abc.jsp

[DEBUG] PortalDriverServlet - Processing render request.

[DEBUG] PortalDriverServlet - Rendering Portal: Requested Page: null

[DEBUG] RenderConfig - Requested page is null.  Returning default: Test Page

[DEBUG] PortalDriverServlet - Dispatching to: /WEB-INF/themes/pluto-default-theme.jsp

[DEBUG] PortletTag - Evaluated portletId to: /testsuite.TestPortlet1

 

 

Is this is a BUG, as it is displaying the wrong page or am I doing it wrong. My requirement is very clear that I have to include a portal page or a portlet into an existing JSP page.

 

Is there any other way by which I can include portal pages (or atleast portlets) into a jsp page. I have also tried tags like Pluto:portlet and portlet:renderURL but couldn’t get them working. I will be very thankful if someone can send me the code to include Pluto Admin page in a jsp.

 

 

Thanks and regards,

Bhupesh

Reply via email to