Servlet Session data being shared

I have a bunch of servlets tha basically generate reports. The problem I'm having is that when two users run the same servlet at about the same time, one of the reports will be over written by the data of the other report. It almost seems that the users are sharing the same context.
Is there any way to fix this or do you have ny suggestions, tips as to how to prevent this.
Thnaks in advance for any help you may provide.

I ran into a similar problem not to long ago with sessions. I had an instance or global reference to the session object in my servlet. When two or more people used the servlet at just the right time I would get problems where data was getting used across sessions. For example:
public class FooServlet extends HttpServlet
     HttpSession session;
     doGet(HttpServletRequest req, HttpServletResponse res)
          session = req.getSession(false);
          doStuffWithSessionData();
     doStuffWithSessionData()
          String temp = session.getValue("temp");
          //do some stuff
}So, person A would connect to the servlet, and their session would be retreived, and the instance reference would get set to their session. Person B would connect at about the same time, their session would get retreived and the instance reference would get set to theirs... right before the getValue("temp") on person A's session is called. So, whatever I was doing for person A would end up using the data out of person B's session. I like to call this a race condition.
It is important to keep in mind that servlets are accessed by multiple threads concurrently, so you need to make sure your servlets are thread safe. Instance variables that get modified with each request are a very bad, non-thread safe thing and will cause odd behaviour like what you are describing. I speak from experience.
I fixed the above by removing the instance reference and doing the following:
public class FooServlet extends HttpServlet
     doGet(HttpServletRequest req, HttpServletResponse res)
               doStuffWithSessionData(req);
     doStuffWithSessionData(HttpServletRequest req)
          HttpSession session = req.getSession(false);
          String temp = session.getValue("temp");
          //do some stuff
          //NOTE: this works most of the time. However, if the client
          //connects with more than one browser window using the same
          //session, I could run into some trouble here too.
}That was a quick fix. However, what I really need to do is create a separate class to encapsulate all user session data and access the session and all data through public static synchronized methods on that class, passing it the request object when I do it. That way all data is stored in one object, and that object is used to do all session access in a thread-safe, synchronized manner.
I hope this information helps you and is understandable. If you have any questions I will try to clarify. Making things thread-safe can be a daunting task.

Similar Messages

  • Restricting particular session variables being shared

    i am using weblogic 10.3.
    I have an EAR with has 2 WAR in it , with session sharing enabled in the weblogic-application.xml . I understand that this will make all the variables that are added in the session to be shared by both WAR, but i want a particular variable added in the session not to shared by both WAR, it should be accessible by only WAR1.
    Please help me
    Zeeshan

    "Restricting particular session variables being shared"
    You can use the 'transient' keyword for this purpose, for example,
    public class Example implements Serializable {
        private String replicate;
        private transient String notReplicate;
    }The 'replicate' attribute is replicated when the Example object is put in the session, the 'notReplicate' attribute is not.

  • Variable data being shared by users !!

    I came across these problem,and don't know what could be the reason.I have this JSP application which is in the server,and I found out that one user is seeing the data ot other user.I mean when the screen (jsp pages) is opened by a user for the first time it shows some data which actually has been entered by some other user at some other terminal (but same server) !!
    Can some one explain what could be the problem
    By the way I am using a bean whose scope is application
    <jsp:usebean id = "MyObject" class "MyClass" scope="application" />
    and
    also all my code inside JSP is inside <% %> tag.
    and
    all my variables declared inside the bean and are public (I know it is a bad programming practice !)
    Help.

    Correct. By public that means that any of your classes that can get a handle on that object can just reach in and manipulate that variable directly.
    Scope is very important. You should take some time to read up on it and learn which one to use for different situations. My guess is that you should be using the session scope in this case, but that difficult to determine without knowing what you are trying to do.
    Hope that helps.

  • Showing session data on new servlet

    I am writing a java servlet and trying to bring session information to another servlet screen in order to edit the data. When I bring up the fields on the screen the session data does not show. Here is a copy of the java program.
    public void doPost( HttpServletRequest req,
    HttpServletResponse res)
    throws ServletException, IOException
    res.setContentType("text/html");
    PrintWriter out = res.getWriter();
    HttpSession session = req.getSession(true);
    if(session == null)
    System.out.println(" No record found.");
    else
    String memberID = (String)session.getAttribute("memberID");
    System.out.println("Record found in modify. " + memberID);
    out.println("<jsp:useBean ID=\"memberID\" CLASS=\"Member\"/>");
    out.println("<jsp:SetProperty NAME=\"setMemberID\"PROPERTY=\"memberID\" />");
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Member Modify</title>");
    out.println("</head>");
    out.println("<body ONLOAD=\"dynAnimation()\">");
    out.println("<p ALIGN=\"center\" STYLE=\"border: 4px ridge #FFFF00; \">");
    out.println("<font SIZE=\"5\" FACE=\"BookmanITC Lt BT\">MEMBER MODIFY</font></p>");
    out.println("<form METHOD=\"POST\" ACTION=\"http://localhost:8080/servlet/PetShop.membermodify\" " +
    "ONSUBMIT=\"location.href='_derived/nortbots.htm';return false;\" NAME=\"FrontPage_Form1\" " +
    "WEBBOT-onSubmit=\"return FrontPage_Form1_Validator(this)\">");
    out.println(" <p ALIGN=\"center\"> </p>");
    out.println(" <p> </p>");
    out.println(" <p ALIGN=\"left\"> " +
    " & nbsp; Member ID: " +
    " <input TYPE=\"text\" NAME=\"memberID\" value='<%=req.getParameter (\"setMemberID\")%>'" +
    "SIZE=\"20\" MAXLENGTH=\"20\" TABINDEX=\"1\" />");
    I've also tried:
    value="<%=setMemberID%>"
    But I either get no data or the expression I put in. I also did a system.out.println to see if the session data is there and it is.

    String memberID =
    (String)session.getAttribute("memberID");
    System.out.println("Record found in modify. " +
    memberID);
    value='<%=req.getParameter (\"setMemberID\")%>'"
    I've also tried:
    value="<%=setMemberID%>"
    But I either get no data or the expression I put in.try memberID instead of setMemberID
    (as in value="<%= memberID %>" or request.getParameter("memberID") )

  • Retrieving session data in JSP  which is forwarded from a servlet

    I'm trying to retrieve session data which is set in a servlet and pass to a jsp. But its returning NULL . The session IDs are equal.
    Scenario:
    JSP display the checkbox, user selects it and submits to a servlet. the servlet display the selected items and stores the data in session.
    when the user press back button in servlet all i want to do is display those checked box which were selected before as checked in the JSP so that user can edit.
    Following is a small test code
    JSP
    <html>
         <head>
              <title>Item List</title>
         </head>
         <body bgcolor="#fedeab"><br><br><br>
         <p align=center>
              <font size=4>
              Choose the item you want!!!
         </p>
         <form action="/demo/showitem" method="post">
              <%=session.getId()%>
              <div align=center>
              <fieldset style="width:250px">
              <legend style="text-align:center">List of item</legend> <br>
              <%     
                   if (session.getAttribute("book1")!=null) {
              %>
                   <input type="checkbox" name="book1" value="book1" checked > Book 1 <br>
              <% } else {%>
                   <input type="checkbox" name="book1" value="book1" > Book 1 <br>
              <% }%>
              <input type="submit" value="Enter">
              </fieldset>
              </div>
         </form>
         </body>
    </html>               
    Servlet
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ShowItem extends HttpServlet
         public void doPost (HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException
              HttpSession session = req.getSession(true);
              res.setContentType("text/html");
              PrintWriter out = res.getWriter();
              out.println(session.getId());
              out.println("<br>");
              out.println("<form>");
              String book1 = req.getParameter("book1");
              session.setAttribute("book1",book1);
              if (book1 != null)
                   out.println ("1." + book1 +"<br>");
                   out.println("<br><br><input type=\"submit\" name=\"buy\" value=\"Buy\">");
              else
                   out.println("No item to display<br>");
              out.println("&nbsp&nbsp<input type=\"submit\" name=\"back\" value=\"Back\">");
              out.println("</form>");
              RequestDispatcher page = getServletContext().getRequestDispatcher("/jsp/litemlist.jsp");
              if ((req.getParameter("buy"))!= null)
                        page.forward(req, res);
              if ((req.getParameter("back"))!= null)
                        page.forward(req, res);
         public void doGet (HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException
              doPost(req,res);
    }

    req.getParameter("book1") is not NULL and returning the value of the checkbox "book1". The problem occurs when the back button is press and try to retrieve the session value in the JSP. At that time, session.getAttribute("book1") returns NULL.
    But if i convert the servlet to JSP then everything is working fine.
    So i wanted to know if there is anything wrong in the way i store the session value in the servlet and forwarding to the JSP.
    Thanks

  • Shared Session Data

    Hello Everyone,
    I have a problem that I could not seem to find a solution or best methods and practices for.
    I have session level data abstracted by a package API and accessed query-inline via a table function. All this works fine; however, there is one caveat that does not. The query SQL is passed to a jobs table and executed by a scheduled job. So the job session can not see the user session data.
    Is there a way to:
    1) Share Session data?
    2) define a table as containing Session temporary data, but public scope?
    3) Group Sessions or grant session privileges (to share scope)?
    4) Run a process/job under a different Session ID, or with specific Session privileges?
    5) Call a procedure or function from one session, but have it Execute under a different session?
    As it stands, I can either copy the data out to a permanent table (and manually implement Session ID, and Session level cleanup), change the current API and underlying global temporary table to a permanent table (and again manually implement Session ID, and Session level cleanup), or before job scheduling parse the SQL, and expand the function table data into the SQL statically.
    None of these are solutions I like. I am looking for something more elegant. Any suggestions would be appreciated.
    *EDIT: sorry, I forgot to add; I'm using Oracle 10g.
    Thank you for your time.
    Edited by: user10921261 on Mar 20, 2009 11:57 AM

    Aequitas wrote:
    I have session level data abstracted by a package API and accessed query-inline via a table function. All this works fine; however, there is one caveat that does not. The query SQL is passed to a jobs table and executed by a scheduled job. So the job session can not see the user session data.Correct. As a job is a brand new session that is created to execute the supplied PL/SQL code. This process does not create the session by inheriting the environment (name space details, temp tables, transactions) of the session that submitted the job.
    Imagine the complexities of this when the session that created the job, terminated 24 hours ago.... would it session state (if kept persistent) still apply? And what about the complexities dealing with the overheads to somehow and somewhere store this session data for the job to re-use.
    Nope.. this is not a workable solution (and nor a sensible one), so Oracle does not support it. When a job is executed, a brand new session is created for that job. (not entirely correct at a technical level as the job queue process may already exist and already have a session - but conceptually, think of a brand new session for a job).
    Is there a way to:
    1) Share Session data?What session data specifically? And what about a session that long since ceased to exist? What about session data that is dynamic and changing? Should then job see the version of that data at the time it was submiited? At the time is started execution? Or the data as it is currently within that session?
    2) define a table as containing Session temporary data, but public scope?Does not need to have a "public scope". It can be managed via an API (PL/SQL), using the job number as unique reference number. It is even possible to create low level access control on such a table that only the job and no-one else can even see the data in that table, except for the job.
    3) Group Sessions or grant session privileges (to share scope)?Nope.
    4) Run a process/job under a different Session ID, or with specific Session privileges?Which session privileges? Remember that each session has two basic memory areas - the PGA (Process Global Area) and UGA (User Global Area). Both are private and non-sharable.
    5) Call a procedure or function from one session, but have it Execute under a different session?Nope.
    As it stands, I can either copy the data out to a permanent table (and manually implement Session ID, and Session level cleanup), change the current API and underlying global temporary table to a permanent table (and again manually implement Session ID, and Session level cleanup), or before job scheduling parse the SQL, and expand the function table data into the SQL statically.Still not sure what you imply with session data.
    In my case I have a process API (running on top of DBMS_JOB ) that developers use to schedule jobs (it manages external processes, mostly used for collecting data from other non-db servers). In some cases, the caller is a Virtual Private Database (VPDB) session - with a name space that contains the keys and tokens and what not that is required for access control and security. The name space cannot be copied across to the job.
    So as part of the process API that creates the job, a logon/authentication/authorisation call is added. With the calling session username. This is the same call that would have been made when the user session was created at logon time. And this call creates the name space that contains the keys and tokens required. Thus creating that batch (job) session in the background, uses the same initialisation processing that an interactive session (created from the app server) would use. The code running in that job is oblivious to the fact that the session was not created via an interactive logon from the app server.
    None of these are solutions I like. I am looking for something more elegant. Any suggestions would be appreciated.If you truly want an IPC mechanism between two sessions in Oracle, two methods come to mind. Database pipes. Advance Queuing.
    This is not really that complex to implement. IPC itself is not difficult. The difficult part is designing the code around cross-session communication and have that work effectively and efficiently. And within the database session context, this can be not only quite difficult to do, but also not always the very sensible thing to do.

  • Sharing session data ....

    Hi,
    Is there a way to share the same session data between Portal Pages and PHP ( hosted in same IAS) ?
    Thanks,

    ?

  • Loosing session data between servlets...

    Based on the code below I'm loosing the session data i.e the class indexed by the session id is returning NULL. If anyone has any suggestions I would apprciate it.
    Class 1:
    HttpSession session = request.getSession(true);
    Hashtable books = (Hashtable) session.getValue("books");
    if (books == null)
    books = new Hashtable();
    else
         books = null;
         books = new Hashtable();
    session.putValue("books", books);
    Class 2:
    HttpSession session = request.getSession(true);
    Hashtable booksOrdered = (Hashtable) session.getValue("books");
    System.out.println("booksOrdered: "+ booksOrdered):
    The system.out.println statement returns
    booksOrdered: NULL
    Help please
    Lee Paulison Jr

    I forgot to mention that the code was working up until I installed the March 4 - 28 2002 Windows NT Critical updates. The code worked after the update when I changed to a different login name namely Admin. Then after a few hours it stopped working, and continues not to work on any Login. I hope that this last bit of information helps someone come up with a fix.
    Lee Paulison

  • Lost session data on jsps

    I run a jsp on Tomcat. But the Tomcat says that the session is lost and returns a null pointer. There is no session clear statement in my jsp except its pointing out a null session data.
    It works well when I go to a jsp that comes from a servlet processing. But when I click on link that directly calls on a jsp page, the page doesn't finish loading/errs out.
    What to do with this? This works fine in single-serevr instance. But when it's run on a cluster/shared environment, it doesn't.
    Message was edited by:
    rachehernandez

    I'm new to tomcat itself and to this job :) I'm using tomcat 5.0.28.
    I'm not sure how they do clustering in their setup though.
    It's working fine by in a test standalone mode. I do think there's something wrong with the setup. But how would I know?
    The jsp sometimes work , and most of the times not. It works when you try to refresh the page. It also works when it comes from a servlet call. But when its just an href link, it doesn't. JSP is using an object from the session. It throws an exception when it can't find this object in the session. But when I click on a link that calls a servlet to load a jsp that's using the same session object, how come it can load up.
    What's happening with the session?
    Thanks!

  • BEA 100028 Could not deserialize session data.

    Hi there,
    We have a production system which is running WL 8.1 which our J2EE application on top.
    In the WL domain logs the following error occurs :
    ####<Jan 31, 2007 8:50:07 AM CET> <Error> <JDBC> <viepapsro10> <viepapsro10> <ExecuteThread: '0' for queue: 'JMSStore<viepapsro10JDBCStore>.ioThreadPool'> <<WLS Kernel>> <> <BEA-001112> <Test "SELECT 1 FROM DUAL" set up for pool "com.jr.jms.jdbcstore.cp" failed with exception: "java.sql.SQLException: OALL8 is in an inconsistent state.".>
    ####<Jan 31, 2007 8:50:34 AM CET> <Error> <HTTP Session> <viepapsro10> <viepapsro10> <ExecuteThread: '2' for queue: 'weblogic.admin.RMI'> <<anonymous>> <> <BEA-100028> <Could not deserialize session data.
    java.lang.Throwable: com.jr.broadband.webapp.taglib.search.SearchResult
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
    at java.util.HashMap.writeObject(HashMap.java:978)
    at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1296)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
    at weblogic.servlet.internal.AttributeWrapper.convertObjectToBytes(AttributeWrapper.java:171)
    at weblogic.servlet.internal.AttributeWrapper.getObject(AttributeWrapper.java:146)
    at weblogic.servlet.internal.AttributeWrapper.getObject(AttributeWrapper.java:83)
    at weblogic.servlet.internal.session.SessionData.removeAttribute(SessionData.java:613)
    at weblogic.servlet.internal.session.SessionData.removeAttribute(SessionData.java:595)
    at weblogic.servlet.internal.session.SessionData.remove(SessionData.java:807)
    at weblogic.servlet.internal.session.MemorySessionContext.invalidateSession(MemorySessionContext.java:69)
    at weblogic.servlet.internal.session.SessionContext$InvalidationAction.run(SessionContext.java:613)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.session.SessionContext$SessionInvalidator.cleanupExpiredSessions(SessionContext.java:533)
    at weblogic.servlet.internal.session.SessionContext.deleteInvalidSessions(SessionContext.java:410)
    at weblogic.servlet.internal.WebAppRuntimeMBeanImpl.deleteInvalidSessions(WebAppRuntimeMBeanImpl.java:234)
    at sun.reflect.GeneratedMethodAccessor135.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:754)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:733)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1560)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1528)
    at weblogic.management.internal.RemoteMBeanServerImpl.private_invoke(RemoteMBeanServerImpl.java:988)
    at weblogic.management.internal.RemoteMBeanServerImpl.invoke(RemoteMBeanServerImpl.java:946)
    at weblogic.management.internal.RemoteMBeanServerImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    BEAs explanation is :
    BEA-100028
    Error: Could not deserialize session data.
    Description
    Could not deserialize session data.
    Cause
    Failed to deserialize session data.
    Action
    Make sure the object you are putting into the session is serializable and also the non-transient object it aggregates are also serializable.
    If any of the non-transient objects in the entire object graph are not serializable, you will receive this error message.
    which doesn't make a great deal of sense to me, can any one shed any light on what exactly is going on?
    Kind Regards,
    AListair Mckeown

    hi,
    seems like your connection has gone bad, this could happen for a number of reasons I guess. Here it could be either a misconfiguration of the DB driver against the DB version, or perhaps the session data is simply to big.
    google for OALL8 and look for a solution there.
    - [url http://blog.thej2eestruggle.com]Anders Mathisen

  • Saving session data for different browsers

    If I open 2 or more Firefox windows the same session data is saved across the browsers, rather than one for each browser window. Is there a way to handle this?

    Not if you are using cookies as the session tracking mechanism.
    Basically Firefox is treating all its windows as being the same internet browsing "session".
    So it shares cookies across all the open windows. IE does a similar thing for windows opened from links, and File:New Window.
    Because the Servlet container keeps track of your session via the "session cookie" that means that your session data is saved across browsers.
    If you disable the cookie session mechanism on the Servlet container (I think you can do that) and just use the urlEncoding rather than cookies to retain the session, you could probably accomplish your goal. However it would be tricky, and the SessionID would be completely visible in the address bar.
    Cheers,
    evnafets

  • How to share objects between two ADF Faces servlet sessions

    I gather the application scope is one way to go for sharing data between sessions in an ADF application. Are there other more generic methods of sharing data between servlet sessions?
    For example, let's say we have a JDev 101.3 ADFBC/JSF app. (or JDev 11g for that matter). In this app we also register a servlet in web.xml. So two people log into this application and access this defined servlet, creating two instances of that servlet...I guess. Is there a way for those two instances/sessions to talk to each other? Pass data back and forth? Should I read about JMS? Or does application scope sound better? I guess a direct communication would be more tidy, than putting data on an application bulletin board, lilke application scope.
    Any thoughts?

    Hi,
    Only one instance of each servlet defined in web.xml gets created, not one per user. You're right about the sessions though, one per user is created. You're right on the other parts as well I think you could use application scope to do something like that, or the data base for that matter, depending on the use case.
    Regards,
    ~ Simon

  • How do I access session data through an EJB?

    Hi
    How do I access session data through an EJB?
    I am currantly developing a Web service (using ejb's, JBoss.net and Apache Axis). A client making a call to this Web service, is expecting a bussiness-object in return. My problem is that this bussiness-object i stored in a users session data. How do I retrieve this bussiness-object from the users session.
    I have read that this does not work with httpsessions, is this true? If this is true, is it possible to store the bussiness object in a JavaBean e.g:
    <jsp:useBean id="userContextWebImpl" scope="session" class="com.ac.march.client.UserContextWebImpl">
    <%
    String key = "test";
    String value = "This is the value";
    userContextWebImpl.setValue( key, value1 );
    %>
    </jsp:useBean>
    and then retrieve this information through the EJB? Or is it possible to do this by using Statfull JavaBeans? Or can this be done through a nother solution?
    Please help!

    I have created a JavaBean with scope="application" to store some data. The data is stored when a user prefomes a spesific task.
    A different person then makes a call to a Web-Service on the server. The Web-Service then asks an EJB to retrieve the data stored in the JavaBean (servlet cotext). In other words: How do I retrieve this data from the EJB?
    I have tried with this code, but with no luck.
    (ApplicationContextWebImpl is the JavaBean)
    public static String getBookingResult( String key )
         String myResult = null;
         String myKey = key;
         ApplicationContextWebImpl applicationContextWebImpl = null;
         try
              applicationContextWebImpl = new ApplicationContextWebImpl();
              myResult = (String)applicationContextWebImpl.getValue( key );
         catch ( java.rmi.RemoteException e )
         return myResult;
    }

  • Session data not carried over. with IE6SP1 and WL7

    Hi,
    We recently upgraded our clustered WL to WL7x and after that we started seeing
    a strange problem regarding session data of our HTML/Servlet pages.
    When we access the pages through this cluster, the session data(browser cookies
    not accepted) is not carried forward in IE6 SP1. With IE5x it works fine. The
    Local Intranet is always coming as blocked for the cookies. I am not able to reset
    the settings also.
    The same set of programs are working fine with server running WL5x.
    Is it anything due to P3P or is there any setting I should do at WL7 level for
    this problem? When I do the URL rewriting this works fine but, as many are static
    HTMLs submitting servlet request, we are not able to do URL rewriting.
    Any help on this will be highly appreciated.
    Thanks
    kavitha

    It doesn't seem to be a problem with serializable attributes though.
    Also Weblogic doesn't use the distributable tag. So that should
    not matter too.
    Can you investigate further and try to pinpoint the issue?
    When we access the pages through this cluster, the session data(browser
    cookies not accepted) is not carried forward in IE6 SP1What do you mean by session data not carried forward?
    -Vinod.
    "Stjepan Brbot" <[email protected]> wrote in message
    news:[email protected]..
    >
    "kavitha" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    We recently upgraded our clustered WL to WL7x and after that we
    started
    seeing
    a strange problem regarding session data of our HTML/Servlet pages.
    When we access the pages through this cluster, the session
    data(browser
    cookies
    not accepted) is not carried forward in IE6 SP1. With IE5x it works
    fine.
    The
    Local Intranet is always coming as blocked for the cookies. I am not
    able
    to reset
    the settings also.
    The same set of programs are working fine with server running WL5x.
    Is it anything due to P3P or is there any setting I should do at WL7level for
    this problem? When I do the URL rewriting this works fine but, as many
    are
    static
    HTMLs submitting servlet request, we are not able to do URL rewriting.In clustered environment session object must implement Serializable
    interface.
    Also your web application has to have parameter "distributable" set ontrue
    in "web.xml" configuration file.
    HTH

  • Session Data Lost Between JSP's

    Hello,
    I am using Oracle 10g Application Server (9.0.4) on SunOS 5.8. I am trying to upgrade an application previously written for Oracle 9iAS 9.0.2.
    A single JSP (myFile.jsp) is called via a POST operation, and it is initally used to create a frameset that contains two frames. Each frame has a URL link to the same JSP file, with some additional parameters:
    <frameset border="0" rows="*,70">
    <frame NAME="topFrame" SRC="myFile.jsp?PARAMETER1=hello&amp;PARAMETER2=goodbye"/>
    <frame NAME="bottomFrame" SRC="myFile.jsp?PARAMETER1=hello&amp;PARAMETER2=goodbye"/>
    </frameset>
    The problem is that when myFile.jsp is called to generate the actual page for the frames, all the HttpServletRequest data has gone, and only the parameters passed in the Query String remain. I don't want to lose the original POST data - in fact, when I used this on Oracle 9iAS 9.0.2 it preserved the POST data and added the additional queries from the query string so all the parameters were available.
    Has the behaviour of the session manager changed that much between Oracle 9iAS and Oracle 10g 9.0.4? How can I achieve my goal on 9.0.4?
    I tried adding the original POST request to the HttpSession variable as follows:
    session.setAttribute("PARENT_REQUEST",request);
    and then extracting the request data when the JSP is called on subsequent occasions as follows:
    HttpServletRequest newRequest = (HttpServletRequest) session.getAttribute("PARENT_REQUEST");
    But 'newRequest' is actually empty, and it doesn't create an exception. If I debug the session object I notice 2 things:
    1. The session ID remains the same througout all calls of myFile.jsp.
    2. The memory location pointed to by the parameter "PARENT_REQUEST" also remains the same, in the format:
    com.evermind.server.http.AJPHttpServletRequest@1bd5093
    If the session object being passed around by cookies remains consistent, why can I not extract the PARENT_REQUEST attribute from it on subsequent calls to myFile.jsp? Have I misunderstood how HttpSession works? How can I modify my JSP's so that data stored during a session is made available to subsequent calls to myFile.jsp?
    I appreciate any insight you can offer!

    Has the behaviour of the session manager changed that much between Oracle 9iAS and
    Oracle 10g 9.0.4? How can I achieve my goal on 9.0.4?If your experience did suggest something has changed from 9.0.2 to 9.0.4, I would believe that it is more about request management.
    If the session object being passed around by cookies remains consistent, why can I not
    extract the PARENT_REQUEST attribute from it on subsequent calls to myFile.jsp? Have
    I misunderstood how HttpSession works? How can I modify my JSP's so that data stored
    during a session is made available to subsequent calls to myFile.jsp?The "request" in the following code
    session.setAttribute("PARENT_REQUEST", request);
    is just a pointer to the actual request object. Other code, especially the server internal code that manage the http requests and responses can see and manipulate that actual request object. For example, although I am not sure if it is the case, the request objects can be pooled and reused. So it is possible that although "The memory location pointed to by the parameter "PARENT_REQUEST" also remains the same, in the format: com.evermind.server.http.AJPHttpServletRequest@1bd5093", the actual request object at that memory location may have changed. The right way to preserve the original request object is to make a private deep copy of it; however there is no easy way to do that.
    Well, an easy way out is to store directly what you need from the original request. If you would like to store the parameters, try
    session.setAttribute("origParams", request.getParameterMap().clone());
    Although this clone() does a shallow copy, it is probably good enough. To be absolutely sure, you can make a deep copy of everything you need and store them.
    Good luck!

Maybe you are looking for