OK, but... where are stored the objects in a session? I always thought that it was done
using cookies. And cookies are "little strings". We are talking about a big string with
the results of a query in a DB. IU think too much for sending it with a cookie.

Kito D. Mann wrote:

> ASC wrote:
>
> > Yes, I know about session tracking, and I can keep the identity of an user. The
> > problem is: how I keep the results of the query?
>
> Take a look at the API docs again -- you'll notice that you can add objects to a
> session object. So, in effect, you can keep data for a particular session/user. You
> could just add your response string to the session object, and then when the user
> makes a request, return it via HTML or send it via e-mail.
>
> >
> >
> > Simon Christian wrote:
> >
> > > This is a fairly major part of using servlets - session tracking. Check out
> > > the HttpSession class, which allows you to store objects which relate (via
> > > the SessionId) to individual users. This requires that users either allow
> > > cookies, or on URL rewriting.
> > >
> > > I'd put some example code but like I say it's a major part and worth reading
> > > up on properly.
> > >
> > > Simon
> > >
> > > ASC wrote:
> > >
> > > > A few days ago I asked in this list about using JavaMail or sun smtp
> > > > classes. I have decided to use JavaMail classes. (for the only reason
> > > > that I already have the jars ,and it is not so complicated as it seemed
> > > > - to me, at least). Thanks to all that made their comments.
> > > > Now I need a solution for the problem of mail. The idea is simple: the
> > > > user requests certain information to a servlet, which retrieves it from
> > > > a DB. I want the user can obtain a plain text file with the results of
> > > > the query, if he/she wants. (pressing a button,i.e.) The results are
> > > > also diplayed in the page returned by the servlet. A solution is to make
> > > > a call to a different servlet that performs the same query, but doesn't
> > > > return a page, but sends a mail. But it requires the query be performed
> > > > twice. I would like to mantain in memory the string (really big string)
> > > > in the servlet, and depending on the action required, the results are
> > > > sent to a writer (browser) or sent via mail, so when the user clicks the
> > > > button the same servlet uses the same string. But the problem is that if
> > > > I mantain the variable (not declaring it in the service method), can
> > > > occur several requests from different users, so the results arn't the
> > > > same.
> > > > To sum up, I would like receiving some suggestions on how "remember" the
> > > > results beetwen two requests from the same user (without write to disk),
> > > > or some way to not use two servlet that meke the same.
> > > >
> > > > Thanks.
> > >
> > > ___________________________________________________________________________
> > > 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
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Kito D. Mann
> [EMAIL PROTECTED]
> Virtua Communications Corp
>
> ___________________________________________________________________________
> 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

Reply via email to