wood burning stoves 2.0*
The moose likes Portals and Portlets and the fly likes get the paramaters from one jspportlet into another portlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "get the paramaters from one jspportlet into another portlet" Watch "get the paramaters from one jspportlet into another portlet" New topic
Author

get the paramaters from one jspportlet into another portlet

sai prasanna
Ranch Hand

Joined: May 02, 2005
Posts: 167
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
Naseem Khan
Ranch Hand

Joined: Apr 25, 2005
Posts: 809
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


Asking Smart Questions FAQ - How To Put Your Code In Code Tags
GaneshKumar Kumar
Greenhorn

Joined: May 23, 2006
Posts: 24
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

Joined: May 02, 2005
Posts: 167
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

Joined: Apr 25, 2005
Posts: 809
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

Joined: May 02, 2005
Posts: 167
can you provide an url related to above
thanks Naseem
Naseem Khan
Ranch Hand

Joined: Apr 25, 2005
Posts: 809
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 ]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

"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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
GaneshKumar Kumar
Greenhorn

Joined: May 23, 2006
Posts: 24
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
pooja jain
greenhorn
Ranch Hand

Joined: Jan 12, 2005
Posts: 213
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




:d
 
GeeCON Prague 2014
 
subject: get the paramaters from one jspportlet into another portlet