File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Portals and Portlets and the fly likes calling a portlet from servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "calling a portlet from servlet" Watch "calling a portlet from servlet" New topic

calling a portlet from servlet

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
From this:

We can call a servlet from a portlet:

In doView() method:

Can we do reverse? that means, calling a portlet from servlet?

Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

The Ajax portlet typically uses a JSP or Servlet as a resource feed.

Problem with the reverse, is I don't know any way to invoke a portlet without going through the portal server, which triggers the entire theme/skin/etc to be generated. Plus, uniquely linking to a portlet might be a problem. Getting a URL to a specific portlet without getting anything but the portlet might be a problem - I'm not sure how you'd do that.

What I would say is that WSRP might solve this problem. It is a way to make a portlet available as though it were a web service. Linking in to the WSRP interface of a portlet (Web Services for Remote Portlets) might be the direction you're fishing in. WSRP is kewl, but seemed to have fallen out of favour for a while. It is a big part of JSR286, but we won't see any JSR-286 commercial portal servers for a while.

-Cameron McKenzie
I agree. Here's the link:
subject: calling a portlet from servlet
It's not a secret anymore!