• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"P M R",
Please check your private messages.
-Ben
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ben

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

Thanks & regards
Srikanth
 
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
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
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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's.one 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.
 
author
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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
http://www.packtpub.com/building-liferay-portal-enterprise-intranets/book
 
keep an eye out for scorpions and black widows. But the tiny ads are safe.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic