13.2. Portlet to Portal communication

There are times when a portlet needs to signal the portal or share information with it. The portal is the only authority to decide if it will take into account that piece of information or ignore it. In JBoss Portal we use as much as possible the mechanisms offered by the portlet spec to achieve that communication.

13.2.1. Requesting a sign out

If a portlet desires to sign out the user, it can let the portal know by triggering a JSR-286 portlet event. To do so, simply defines the event "signOut" in the namespace "urn:jboss:portal" as a publishing event. In the action phase of the portlet, trigger the event, as a payload you can specify a redirection URL. If the payload is null, it will redirect the user to the default page of the default portal. See the following snippet to use in the action phase, it will ask the portal to sign out the user and redirect him to the JBoss Portal blog:
QName name = new QName("urn:jboss:portal", "signOut");
response.setEvent(name, "http://blog.jboss-portal.org");