File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Portals and Portlets and the fly likes Transfer data from Java beans to 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 "Transfer data from Java beans to portlet" Watch "Transfer data from Java beans to portlet" New topic

Transfer data from Java beans to portlet

John Lincoln
Ranch Hand

Joined: Feb 11, 2003
Posts: 192

How to transfer data from a form to the Portlet. I mean can i set the data in JavaBean with the values in the form ?. Do the bean needs to stored in renderRequest and what should be the scope ?

If you have an example doing that. Can you provide a url. I tired the following, but it did not work.

Thanks in advance

Following is the code:
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

Moving data from a form to a portlet should be relatively straight forward.

Look at the following form that might make up the landing page of a portlet (the field is not namespace encoded, although it should be:

On the portlet side, you can simply pull out the field using the portetRequest:

Now this is an overly simple example, which excludes namespace encoding, not to mention the action processing phase of a portlet, where form handling should be performed. But it is simple, and it works.

Start with the simple, and move on.

Here is a link to the page where you can download the completed war file for this JSR-168 portlet application. It's been tested on both JetSpeed2 and WebSphere Portal Server:

Free Sample Portlets Available for Download and Installation

There are also tutorials on that site that demonstrate some of the more advanced and complicated aspects of portlet development, including the creation of the JSR-168 Struts portlet, and JSR-168 JSF portlet, both of which use the Apache bridge, and both of which handle form input from the user.


-Cameron McKenzie
I agree. Here's the link:
subject: Transfer data from Java beans to portlet
It's not a secret anymore!