Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inter portlet application communication

 
Chinmay J. Shah
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have two different portlets on two different applications(different war files.) Now I want to communicate user logon credentials from one portlet to other (in another application). Is there any mechanism to do so?

Thansk & Regards,
Chinmay
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What type of credentials are you trying to share?

Portlets can't really communicate like this. Portlets are separate war files, and as such, are really separate applications with separate classloaders. You can almost think of them as separate Servlet/JSP applications. Communication between them isn't all that easy.

Now, the portal itself manages user rights, and usually, a portal server provides a member services API that automatically shares credentials. Plus, you always have the User object provided by the API that has some basic methods.

If you really need to share data, you can create a shared database table, or common portlet service (WebSphere) that both Portlets can invoke. That may be the best and most scalable method.

-Cameron McKenzie
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I am not wrong, portlets can communicate with other portlets
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can Portlets communicate with other portlets? If they are JSR-168 portlets, and they are not defined within the same war file, which would allow you to share the PortletSession at the application level, well, then the sad answer is no, they can't communicate.

Fundamentally, a portlet application is packaged in a war. Imagine an accounting application built by IBM, and a human resources application built by oracle, both distributed as war files containing Servlets and JSPs. Could these to applications communicate with each other? No, not really, not unless they added extra functionality through a common web service or something. Servlets and JSPs packages in separate war files cannot communicate with each other through sessions or ServletConfigs or ServletContexts or anything like that.

Portlets packaged in separate war files are exactly the same - they really have no context or session with which they can share information. This is what makes technology like IBM's C2A (Click-to-Action) so compelling - it brokers messages between portlet applications that are not packaged within a common war file.

The JetSpeed API had messaging. We may see something similar in JSR-286, the new portlet specification, but we're still a ways off from that.

-Cameron McKenzie
 
pooja jain
greenhorn
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Cameron McKenzie:
Can Portlets communicate with other portlets? If they are JSR-168 portlets, and they are not defined within the same war file, which would allow you to share the PortletSession at the application level, well, then the sad answer is no, they can't communicate.

Fundamentally, a portlet application is packaged in a war. Imagine an accounting application built by IBM, and a human resources application built by oracle, both distributed as war files containing Servlets and JSPs. Could these to applications communicate with each other? No, not really, not unless they added extra functionality through a common web service or something. Servlets and JSPs packages in separate war files cannot communicate with each other through sessions or ServletConfigs or ServletContexts or anything like that.

Portlets packaged in separate war files are exactly the same - they really have no context or session with which they can share information. This is what makes technology like IBM's C2A (Click-to-Action) so compelling - it brokers messages between portlet applications that are not packaged within a common war file.

The JetSpeed API had messaging. We may see something similar in JSR-286, the new portlet specification, but we're still a ways off from that.

-Cameron McKenzie


portlet wiring is another way to communicate.
 
pooja jain
greenhorn
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by pooja jain:


portlet wiring is another way to communicate.


that works only if portlets are on same page though. nonetheless i am not sure if having in same war is required in portlet wiring or not.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic