Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to store and save the sessions in netscape application server

Status
Not open for further replies.

kumarbabu

Programmer
Aug 11, 2000
8
0
0
US
hi friends i need to know how to save and restore the
sessions in the jsp of the netscape app server.
its not like weblogic. could u please help me out in this
as aspect
 
Sharing session information between JSPs when
using MMapSessionManager in iWS

Issue:20000825-2 Product:iPlanet WS Created:08/25/2000 Version:4.1
Last Updated:08/25/2000 OS:All
Does this article answer your question?
Please let us know!
Problem:

When working with session objects in Java Server Pages(JSPs), I encounter problems when I use
MMapSessionManager . For example, I have written the following sample JSPs:
one.jsp

<%@ page import=&quot;com.ivendor.ui.*&quot; %>

<jsp:useBean id='simpleBean' scope='session'
class='com.ivendor.ui.SimpleBean' type='com.ivendor.ui.SimpleBean'/>
<%
simpleBean.setMessage(&quot;Hello World&quot;);
response.sendRedirect(&quot;two.jsp&quot;);
%>
---------------------------------------------------------------------------------------------------
two.jsp

<%@ page import=&quot;com.ivendor.ui.*&quot; %>

<jsp:useBean id='simpleBean' scope='session'
class='com.ivendor.ui.SimpleBean' type='com.ivendor.ui.SimpleBean'/>

<html>
<BODY>
<%
out.println(&quot;inside two.jsp<br>&quot;);
out.println(&quot;Value of Message:&quot; + simpleBean.getMessage());
%>
</BODY>
</html>
---------------------------------------------------------------------------------------------------
SimpleBean.java

package com.ivendor.ui;

import java.lang.*;
import java.io.Serializable;

public class SimpleBean implements Serializable
{
public String message;

public SimpleBean()
{
;
}

public void setMessage(String str)
{
message = str;
}

public String getMessage()
{
return message;
}
}
---------------------------------------------------------------------------------------------------

When testing the JSPs, the output from two.jsp is as follows:

inside two.jsp
Value of Message:null

The &quot;null&quot; value for the output on the second line indicates that the message set in one.jsp is not
carried over to two.jsp, which is contrary to the expected behavior of the JSPs when the scope is
set to &quot;session.&quot; However, the sample JSPs work properly with SimpleSessionManager.
Workaround:

To work around this problem, manually re-register the bean object to the session object after changing
the bean's properties, using the following example:
one.jsp (modified)

<jsp:useBean id='simpleBean' scope='session' class='com.ivendor.ui.SimpleBean'
type='com.ivendor.ui.SimpleBean'/>
<%
simpleBean.setMessage(&quot;Hello World&quot;);
session.setAttribute(&quot;simpleBean&quot;,simpleBean);//re-register the bean
response.sendRedirect(&quot;two.jsp&quot;);
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top