Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transfer data from Java beans to portlet

 
John Lincoln
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Enjoy!

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic