tags:

views:

8

answers:

1

That's a pure newbie question.. actually not even newbie.. still investigating! I want to know if 2 instances of the same Portlet would have separate scopes? What is this scope called, maybe Application Scope? Would that hold if they are deployed on the same WAR?

A: 

The JavaDoc of the PortletSession class says:

"All objects stored in the session using the APPLICATION_SCOPE must be available to all the portlets, servlets and JSPs that belongs to the same portlet application and that handles a request identified as being a part of the same session. Objects stored in the session using the PORTLET_SCOPE must be available to the portlet during requests for the same portlet window that the objects where stored from."

There you go. PORTLET_SCOPE is the scope for each instance of a portlet.

P.S: read the JavaDoc of the APIa you want to use before asking these questions.

Rambaldi