Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

portlet session

 
Dorothy Taylor
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi


Are there any things that we should keep in mind while developing JSR -168 portlets as regards the session? Is session optimization a concern? What all things should be kept in mind while placing an object in session? How big can the session be?

Appreciate your help
Dorothy
[ January 27, 2008: Message edited by: Dorothy Taylor ]
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The same rules that apply to HttpSessions apply to the PortletSession. In fact, under the cover, they are usually the same thing. Minimize session use when possible, but don't do it at the expense of the ease of development and maintainability.

Here are some JSR-168 Portlet Development Best Practices that I put together, which includes some discussion of the Portlet Session:

Portal & Portlet Development Best Practices

Kind regards,

-Cameron McKenzie
 
Sathya Sekar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am just starting to get some hold on the portlet session and was wondering (
pl pardon if this is totally incoherent and I am just jumping the learning gun..)

Lets say we have two different portlet apps (2 wars) - is it possible :
a) to have a single window which can display portlets across both these apps
b) if yes, how does the session behave ? I mean, since these are two different portlet apps, the portlet scopes would be different for the two which could mean that they dont share the same session id. Is this right ?

Thanks.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many times the complexities of the portal can be alleviated by relying on your knowledge of plain old Servlets and JSPs.

With Servlet and JSP apps, the session can't cross a war file. The exact same thing can be said for a portlet war file - you can't share sessions across a war.

Why not put both of these portlets in the same war? If there's a compelling reason for them to communicate, then perhaps they should be packaged as part of the same app. Just add another entry to the portlet.xml file. So many portlet books (not mine of course) only ever show one portlet per war file. I can't think of too many J2EE applications with only one command object, so why would most portlet applications only have one portlet? (sorta equiavlent to a JSF or Struts command object).

Think about it.

-Cameron McKenzie
[ January 28, 2008: Message edited by: Cameron McKenzie ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Dorothy",
Please check your private messages.
 
Fred Grott
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dorthy,

I face the same problem, google IPC library

You will have to ejb side it with a db table to store the sessions and use the library to send sessions via message que
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic