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 Can I make a call to another portlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "Can I make a call to another portlet?" Watch "Can I make a call to another portlet?" New topic

Can I make a call to another portlet?

Srikanth Ganji

Joined: Apr 03, 2008
Posts: 24
Hi All,
Iam new to portlets can any one answer the below query.
I need to call some other portlets depending upon the successfull login.
Is it possible using JSR 168 portlets?

Thanks in Advance
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

You can package multiple portlets within a common, single, portlet applicatio war file. These portlets can share information through the Application Scope of the PortletSession. Check out my signature links for some free tutorials on the subject.

However, JSR168 portlets don't really call each other. There's no mechanism to do that, and it's not really how portlets are intended to work. Portlets are supposed to be independent creatures sharing space on a portal page.

What you might need is a JSF portlet that allows a wizard like experience through a portlet. It's a very proven pattern.

Also, IBM provides things like C2A, click-2-action, to provide inter-portlet communication. They also provide a PortletService framework to perhaps facilitate sharing information. IBM specific though, so don't bet the interoperabiliy of your portlets on it.

Keep asking questions - we'll get you thinking like a portlet developer in no time!

-Cameron McKenzie
Srikanth Ganji

Joined: Apr 03, 2008
Posts: 24
Hi Cameron McKenzie,

My req is to show the other features like policy's the user is having other Info about the policy's in seperate portlets after successfull login of the user.
Hence I want to call one portlet from the other things to retrive the user related all other Info depending upon successfull login in different portlets.
Just want to know the info that there is a login for each and every portlet site is that validated against the user's created in the Application server i.e somthing like IDMS which is having the user details or we can store the info about loginid and password in the database.

can you throw some light on it.

Thanks & regards
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

The PortalAPI allows you to obtain a User object that allows you to obtain all sorts of information about the user, and the RenderRequest defines a variable called USER_INFO.

RenderRequest API

Any portlet can grab this information. If the portlets are on the page, you can have them display. The portal page aggregation mechanism will call the view mode of any portlet placed on a page, and perhaps those portlets could grab this information and display the information you're interested in.

-Cameron McKenzie
Jonas X. Yuan
Ranch Hand

Joined: May 18, 2008
Posts: 108
The Answer is YES.

There is a simple way to do it: by page's parameter.

Here is an example,

1) navigation portlet (games navigation), input keyword "test" and and press GO;

2) in the same page, browse portlet takes this keyword "test" and do keyword-search for games, and then display search results.

Here is real example (Liferay Portal):


Jonas Yuan
[ June 14, 2008: Message edited by: Jonas X. Yuan ]

Books: Liferay Portal 6.1 Systems Development
It is sorta covered in the JavaRanch Style Guide.
subject: Can I make a call to another portlet?
Similar Threads
jboss portlet
deadlock static int / performence ???
Struts validator with portlets
Inter portlet application communication