Setting Complex objects in Action phase in Webshere Portal


It is sometimes required to pass some of the complex objects from ProcessAction() method to Render() method. The same can be easily achieved by passing the object using the below method:


We have add this in our Portlet.xml file


Changes in Portlet Class

public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
           if( request.getAttribute("EMPLOYEE_DETAILS") != null ) {
                    System.out.println("Not Null ");
          } else {

public void processAction(ActionRequest request, ActionResponse response) throws PortletException, {
             Employee employee =new Employee();
             request.setAttribute("EMPLOYEE_DETAILS", employee );

No comments:

Post a Comment

Recent Posts

Popular Posts

© 2011-2019 Web Portal Club