0

In JSR286, we can go from one portlet to another by:

1) Simple navigation 2) Using IPC(Inter Portlet Communication)

I have two portlets A and B. Both are having corresponding Portlet.java file(which handle life cycle of portlet). When we go from A to B using IPC the Portlet.java of B will get called, but if we go from A to B using navigation, what will happen that time? In navigation will the Portlet.java of B will get called or not?

(Here we are assuming that both portlets A and B are in same portlet container.)

Gaurav Jeswani
  • 4,410
  • 6
  • 26
  • 47

1 Answers1

1

Well, when you visit a portlet by opening a page on the portal and you go from page containing portlet A to the page containing portlet B, it will only pass the render phase of the portlet, for example:

  1. User goes to page A
  2. Portal container calls RENDER phase of portlet A
  3. User goes to page B
  4. Portal container calls RENDER phase of portlet B

However, when using wiring or IPC, you're going to do some additional steps. First of all, setting an event (in portlet A) can only be done in the action phase, so you'll have to send an action request to portlet A first. Then it will send the event, on which the event broker (part of the portal container) will react and send you to the right page, in which it will enter the event phase (processEvent()), followed by the render phase.

So it will look like this:

  1. User goes to page A
  2. Portal container calls RENDER phase of portlet A
  3. User triggers an action (clicking button/link)
  4. Portal container calls ACTION phase of portlet A
  5. In stead of normally going to the render phase, you set an event
  6. Portal container calls EVENT phase of portlet B
  7. Portal container calls RENDER phase of portlet B

So there are additional steps necessary for a inter portlet communication to work. First of all you have to trigger an event in the action phase of another portlet and secondly, it will first enter the event phase of the destination portlet before going to the render phase.

Gaurav Jeswani
  • 4,410
  • 6
  • 26
  • 47
g00glen00b
  • 41,995
  • 13
  • 95
  • 133