• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What are the different portal scopes?

 
Christian Nicoll
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

i'm trying to get a clear understanding about the different scopes in an portlet application to compare them with an traditional Servlet/JSP application. I've created this small picture:


This is my understanding how it works:

Servlet/JSP application
- It exists only one HTTPRequest. During the life of an Servlet-application there will be create (and deleted) many HTTPRequests.
- Each user has it own session. Over this session servlets can save and load information (attributes) and every other servlet in the same application can access this information.
- If I've got very common information, which are not user-specific then I'll put them in the application scope (ServletContext).

Portlet application
- A portlet application doesn't have only one single HTTPRequest. Here the HTTPRequest is transformed into a PortletRequest, which can be either an ActionRequest, or an RenderRequest. By default information which a stored in one Request are not accessible in the other/next request.
- Another big difference is that there is not one single session object for an user. Instead there exists for every portlet-instance an own portlet-session. If I want to share information between two different portlets on the same page then I've to use the APPLICATION_SCOPE of the PortletSession.
- If I got data which is very common and not user-specific then I'll put it directly at the application scope.

Is my understanding correct?

Best regards,
Christian
scopes.PNG
[Thumbnail for scopes.PNG]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic