• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

get the paramaters from one jspportlet into another portlet

 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
i have a jsp portlet with 2 textfields by names username,pwd and i want to get the paramaters into another portlet.any body please help
thanks in advance
saiprasanna
 
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Communication between the portlets can be done by Presentation Context.

Secondly you can aso do the samething by providing the listeningTo

attribute of one portlet as the portlet id of second one.

Naseem
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sai,
If the two portlets are in the same Application you can do this.
Get the text box entries from the jsp. Store the values in the PortletSession in your Portlet class. Use Application scope for the session.
Get the attributes from the PortletSession in the second portlet.

Thanks.
Ganesh
 
sai prasanna
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Naseem and Ganesh
can we use Page Flow concept in the above scenario and
we are using weblogic portal 9.2 for portlets iam new to portlets can you provide step by step process to accept parameters
regards
prasanna
 
Naseem Khan
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by sai prasanna
i have a jsp portlet with 2 textfields by names username,pwd and i want to get the paramaters into another portlet.any body please help



With two text fields username and password, jpf portlet is better. Why you are creating jsp portlet for that.

Create a jpf portlet. After the rendering of the portlet, From its begin action, forward to login.jsp. There you will allow user to enter username and password details. On submission, call say process action of same jpf. In process action, you need to retrieve the request parameters using getRequest() method.

Then set login details in outer request so that other non-page flow portlet like a jsp portlet which are not the part of page flow can get it from request.

with request scope, only jsp and actions which are part of page flow can retrive it from request scope. However, if you want to get it in a different portlet which is definitely not a part of this page flow, then you require outer request.

How will you create an instance of outerRequest here is the code....



Hope this will help

Naseem
 
sai prasanna
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you provide an url related to above
thanks Naseem
 
Naseem Khan
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no book in India or any url you an find what I told you. bea online help is the ony resource which you have already posted. I purchased one book from US and that was on Weblogic workshop. That book covers to some extent weblogic portal things.

Naseem
[ July 20, 2006: Message edited by: Naseem Khan ]
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"jpf portlet" Yes, but jpf is proprietary of BEA, so if you use it you are now vendor locked. jpf is not defined in the Portlet Spec.

If you put the attribute into the Application scope from one portlet, you must remember that it will only be there for the other portlet if the processAction of the first portlet is called, if a different Portlet on the page has their processAction called, then the attribute will not be there for the other Portlet.

Mark
 
GaneshKumar Kumar
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sai,
You can refer this example.
consider CityPortlet and WeatherPortlet, two portlets in the same application.

In processAction() of CityPortlet:
portletSession.setAttribute("cityName", newCityName, PortletSession.APPLICATION_SCOPE);
In the WeatherPortlet, you can retrieve the changed city name by getting it from the PortletSession:

In doView() of WeatherPortlet:
currentCityName=(String)portletSession.getAttribute("cityName",PortletSession.APPLICATION_SCOPE);

Remember the following from Mark's reply
If you put the attribute into the Application scope from one portlet, you must remember that it will only be there for the other portlet if the processAction of the first portlet is called, if a different Portlet on the page has their processAction called, then the attribute will not be there for the other Portlet.

Thanks.
Ganesh
 
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 Naseem Khan:
Communication between the portlets can be done by Presentation Context.

Secondly you can aso do the samething by providing the listeningTo

attribute of one portlet as the portlet id of second one.

Naseem



 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic