• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session Tracking in Websphere

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am calling a JSP from a Servlet. In the Servlet I am puting an object in session. In the JSP i am getting the same session. This JSP is a frame set and calls two other JSP's. The JSP's that are called in this frame set does not have the same session ID. How do I carry the same session ID from the frame set JSP to the other two jsp. I am running this application in Websphere.
I tried using response.encodeURL but still does not work. Can any one suggest what is the problem.
Code in Frame set JSP :
<%@ page session="true" %>
<%@ page language="java" %>
<%@ page errorPage="errorPage.jsp"%>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="javax.servlet.*" %>
<%@ page import="javax.servlet.http.*" %>
<%@ page buffer="2080kb" autoFlush="true" %>
<%@ page import="com.jbh.apps.filenet.pod.*"%>
<%PodUserBean userBean = (PodUserBean) session.getAttribute(PodConstants.USERBEAN);
%>

<HTML>
<HEAD><TITLE></TITLE></HEAD>
<frameset frameborder="0" framespacing="0" border="0" cols="*" rows="60,*" >
<frame marginwidth="0" marginheight="0" src="<%=response.encodeURL("pod/header.jsp")%>" name="headerFrame" noresize scrolling="no">
<frame marginwidth="0" marginheight="0" src="<%=response.encodeURL("pod/podSearchCriteria.jsp")%>" name="contentFrame" noresize scrolling="auto">
</frameset>
</HTML>
 
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
To the best of my knowledge the problem is not with Websphere session management. The problem you are experiencing is probably due to the way framesets work. This occurs because the browser fires two requests (one request per frame) to the Webserver - the webserver forwards these requests to websphere. Because the browser hasn't passed the session information to these requests websphere creates two new sessions.
If you think about what you are asking you are effectively saying "I want multiple frames to access the same session", which would open the problem of multi-threading on the session instance.
I'm sure that this isn't what you have in mind so you probably want to look at re-designing the solution - rather than frames use why not construct the page by using jsp directive

I hope this helps,
Steve
 
Sat Ram
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Steve
This Code works fine in Weblogic.
 
Sat Ram
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone tell me how to make it work in websphere.
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do you transfer call to JSP from servlet? Is it a redirect or forward? Is there any special webserver exists infront of Websphere?
 
Sat Ram
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use this code to transfer from Servlet to JSP. In the JSP which has a frame set I get the same session from the servlet. But when I call two other JSP's in the frame set.I loose the session in the called two JSP's.I am using websphere 3.5.4 and there is no other webserver in front of this.
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(response.encodeURL("/pod/podHome.jsp"));
if (dispatcher != null) {
dispatcher.forward(request, response);
}
 
Steve Granton
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
In that case - have you checked the Session Manager Service settings on Websphere - are you using cookies for session management rather than url encoding? Maybe this is your problem.
Cheers,
Steve
reply
    Bookmark Topic Watch Topic
  • New Topic