• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Inter portlet application communication

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I am not wrong, portlets can communicate with other portlets
 
Cameron Wallace McKenzie
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
greenhorn
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
catch it before it slithers away! Oh wait, it's a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic