Forums Register Login

Obtaining session objects in pop-up window

+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
I would suggest you to first debug your code and check if the session object and ModifyContent.SESSION_BEAN objects are not null.
The only cure for that is hours of television radiation. And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1290 times.
Similar Threads
Javascript Guru Needed
Problem with pop-up window
modal pop up not closing
Focus on child window after parent window gets refreshed
Problem with pop-up window
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 23:33:29.