Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Obtaining session objects in pop-up window

 
r rafanan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I was wondering if anyone had success obtaining a session object in a popup window.

My scenario is that once a user enters date on a jsp page, he clicks submit.

The action is listened to in my portlet (or in your case, maybe a servlet).

I then take these values and save them in a session object, thus initializing the session object with these new values.

I have a "Preview" button that explicitly does this
window.open('<%=response.encodeURL("/xxx_application/jsp/html/ModifyContentPreview.jsp")%>');
/// dont worry about the response.encodeURL, this is strictly portal coding specific

Thus opening the jsp page in a popup window

When I try to retrieve the value of the session bean, I always get a null in return.

ModifyContentSessionBean sessionBean = (ModifyContentSessionBean)request.getSession().getAttribute(ModifyContent.SESSION_BEAN);

Does anyone have any ideas, or not obtaining a session object is a
given in pop up jsps?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depending on your application server, you may need to enable url rewriting in the configuration before it will actually do anything. You need to use this since there is a bug in some versions of IE that prevents popup windows from passing the session ID back, and hence gives the popup a new session.
 
Rajesh Agarwal
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would suggest you to first debug your code and check if the session object and ModifyContent.SESSION_BEAN objects are not null.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic