Developer Zone
Register  | Login  
 Mainsoft.com
Search  
 
Mainsoft for Java EE  

Portlet request processing


This feature applies to the Mainsoft for Java EE Portal Edition only.

The portlet specification, JSR 168, differs from ASP.NET in the request processing model. Mainsoft for Java EE suggests a unified model that automatically gaps the bridges between the two models.

Background

The JSR 168 model

The portlet specification, JSR 168, defines two main phases in the request processing: the processAction phase and the render phase.

In a typical scenario, a user selects a page, which triggers a GET request, and the portlet container sends the request to each portlet on that page to render output in its response. These requests are called render requests. Other requests, however, are launched when the user interacts with the portlet, for example by clicking a Submit button. Such actions trigger a POST request and a URL to the portlet is generated. These are called action requests. as they may require the portlet to process an action before sending the response.

If the portlet receives an action request, then the processAction phase is started and the portlet's action processing method is called. The result of this action could invoke actions for other portlets on the page. After actions have been completed for all portlets on the page, each portlet's rendering method is called. The processAction phase is guaranteed to complete before the start of the render phase.

The ASP.NET model

In the ASP.NET model, there is no division into two phases.

When an ASP.NET page runs, the page goes through a life cycle in which it performs a series of processing steps. These include initialization, instantiating controls, restoring and maintaining state, running event handler code, and rendering.

The common life cycle Page events are:

  • PreInit

  • Init

  • InitComplete

  • PreLoad

  • Load

  • Control events (such as Button_Click)

  • LoadComplete

  • PreRender

  • SaveStateComplete

  • Render

  • Unload

The Mainsoft implementation

In the Mainsoft model, if the portlet life cycle involves only a render request, the Page events are all called in the render phase. If the portlet life cycle involves a processAction request, all the Page events until OnPreRender (inclusive) are called in the processAction phase. The rest of the events are called in the render phase. Mainsoft persists the Page object between the processAction and the render phases in the session, making the separation between the two phases transparent to you.

There are some operations that must be performed in a specific JSR 168 portlet phase:

In the processAction phase
  • Set and get IPC data

  • Set window state

  • Set portlet mode

  • Set render parameters

To learn how, read Interacting with the portlet container and Using inter portlet communication.

In the render phase
  • Create action URLs

  • Create render URLs

To learn how, read Portal ASP.NET expressions.

See Also

Portlet Designer

Related Sections

Portal integration

Learn about the Mainsoft for Java EE Portal Edition features.


Home  Site map  Privacy statement  Legal notice  Contact us
Mainsoft Product Validations: Optimized for Microsoft Visual Studio, Java Powered for the Enterprise, and Ready for IBM WebSphere.
Read more about: .NET Java and .NET for Linux

Copyright © Mainsoft Corporation 2005-2009. All rights reserved.