Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to display the results of one portlet in another portlet(JSR 168 )?

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a portal page with 3 portlets developed following the JSR 168 specification standards. Now, I want to display the results of 1st portlet in 2nd portlet when a submit button is clicked on the first portlet. Is there any solution to achieve this ? All the portlets are developed using Spring porltet mvc framework, portal server is Vignette 7.2 and application server is weblogic 8.1.5. Thanks in advance.
Posts: 13411
Firefox Browser VI Editor Redhat
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ben

Can you Pl. send me also as I have the same requirement.

Thanks & regards
author and cow tipper
Posts: 5000
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This all depends on where the other portlet resides.

Two portlets in a common war file can share information through the PortletSession's APPLICATION_SCOPE. Portlets packaged in different war files cannot.

CBT Tutorial on How to Use the PortletSession's APPLICATION Scope

A single portlet can have several JSP pages associated with it. So, a portlet can get fed input from one JSP, and display results generated by a different JSP. This might accomplish your request a bit better. For more advanced, wizard like applications, you can always use the JSF Portlet or the Struts Portlet. I have some tutorials on how to create those in my signature links.

For portlets in separate war files, you can always write data to a database table in one, and have the other portlet read from that database table and generate the results. JDBC is available in all portlets. IBM has something called a PortletService that helps facilitate this process.

All of this though is a way of saying that really, it's not inherently possible to have one portlet display the results of the other portlet. Portlets are intended to be independed of each other. What if the user removed that second portlet from their page? You'd have one portlet taking in data, but no portlet to display the data. Does that make sense? Probably not.

Being a portlet developer requires a bit of a mind shift away from Servlets and JSPs. Start trying to think like a portlet developer, and you'll run into less of these issues.

Best of luck!

-Cameron McKenzie
P M Rao
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cameron,

Thanks a lot for your reply.
To be more specific,
All the 3 portlets are in the same war file.1st portlet is associated with 2 different jsp' jsp is having input fields and a submit button and the other jsp is for displaying the results. Now if i enter some values in the first jsp and click on submit button the 2nd jsp(results jsp) is displayed replacing the 1st jsp in the same place. But my requirement is, the results jsp has to be displayed in the 2nd portlet with 1st jsp in first portlet remains same even after submit button is clicked.
To achieve this i hav set the values entered by the user in the 1st jsp of first portlet in the application scope. The setting of values into the application scope was done in controller of first portlet. Now i am able to access those values in the controller of 2nd porlet. With these values i called the web service deployed in a remote machine and was able to get the results in the 2nd portlet controller. Now my question is can i display those results in the jsp which is associated to this 2nd controller ?? can anyone please suggest how to do this ?? Please pass your advices if i am wrong with my approach. thanks in advance.
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Liferay Portal provides one portlet:

Nested portlets: holds one or more portlets inside. It provides nested portlets layout, that is, portlets within portlets.

Abstract from Liferay Book
Space seems cool in the movies, but once you get out there, it is super boring. Now for a fascinating tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic