The new SessionData object doesn't do anything. It only stores data and provides
method for storing and retrieving that data.
public class SessionData
{
int longfield;
public SessionData() {}
public void setLongfield(int longfield){ this.longfield=longfield; }
public int getLongfield(){ return longfield; }
// so on for other data
}
Then in servlet after getting value for longfield:
int longfieldValue = // GET IT FROM DATABASE
SessionData sData = new SessionData();
sData.setLongfield(longfieldValue);
session.putValue("SessionData",sData);
then in JSP:
<jsp:useBean id="dataBean" class="SessionData" scope="session"/>
You have retrieved the following value: <%= dataBean.getLongfield() %>
dave.
Palanisamy Easwaran wrote:
> Hi,
> Do you want me to create a SessionData object of own? or Does JWS provide it?
> If I want to create SessionData object, what does it do actually? some sort of
> code is welcome.
>
> thanks in advance,
> -easwaran.P
>
> ---------------------------------------- Message History
> ----------------------------------------
>
> From: [EMAIL PROTECTED] on 10/27/99 04:47 PM GMT
>
> Please respond to [EMAIL PROTECTED]
>
> To: [EMAIL PROTECTED]
> cc:
> Subject: Re: caching long field as session data in JWS memory
>
> Instead of putting the data into session why not create an object to store that
> data
> and store the reference to that object in session?
>
> SessionData sData = new SessionData(longfield);
> session.putValue("SessionData",sData);
>
> This way you have SessionData object for more data.
>
> data i mean dave.
>
> Palanisamy Easwaran wrote:
>
> > Hi,
> >
> > I tried to cache (session.putValue("SessionData",longfield)) a long field
> data
> > which is retrieved from database using JWS , it worked for few records.
> > But, when I tried the same with more number of records , ofcourse I got the
> > expected exception
> >
> > java.lang.OutOfMemoryError at java.lang.StringBuffer.append(Compiled
> Code)
> > at
> > MyDbServlet.doGet(Compiled Code) at
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:715) at
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:840) at.
> >
> > I would like to know what is the maximum size of session data can be cached in
> > memory of a web server?,
> > how do we identify the size of session data allowed in cache of a web server?
> >
> > any help is appreciated,
> >
> > thanks in advance,
> > easwaran.P
> >
> > ___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> --
> David Mossakowski [EMAIL PROTECTED]
> http://www.dwdog.com/styk 212.310.7275
>
> "I don't sit idly by, I'm planning a big surprise"
> F U G A Z I
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
--
David Mossakowski [EMAIL PROTECTED]
http://www.dwdog.com/styk 212.310.7275
"I don't sit idly by, I'm planning a big surprise"
F U G A Z I
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html