Hi Friends,

Following code describes how to put values in sessions and then retrive
them.


        Integer attempts = (Integer) session.getValue
("sessiontest.counter");
        if (attempts == null) attempts = new Integer (1);
        else attempts = new Integer (attempts.intValue () + 1);
        session.putValue ("sessiontest.counter", attempts);

  if(attempts.intValue()>=4){
   out.println("<h2 align=center> You have exceed  the number of attempts !
</h1>");
   out.println("<h4 align=center>Restart your browser and try again !
</h1>");
   out.println("</body>");


Basically session.putValue("variablename","variable value") is used to store
the values in the session.

session.getValue ("session variable") is used to get the values from
session.


Best regards,

Deepak Kumar

http://jdbc.virtualave.net




----- Original Message -----
From: P.Yesudason <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, April 30, 2000 2:29 PM
Subject: Re: Applet-Servlet


> Jiger Patel wrote:
>
> > Hi Friends,
> >              Can anybody tell me how to access values from Session
object
> > put in by the Servlet from an applet to update itself.
>
> You can use a URL object to i
> "http://sample:8080/servlets/MyServlet "
> nvoke a servlet  then you can try to get the session from there .
> It is possible.
>
>
> >
> > Secondly how to invoke a servlet from an Applet.
> >
> > Thanks in advance,
> > Jiger
>
> -Yesudas
>
> >
> > ________________________________________________________________________
> > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
> >
> >
___________________________________________________________________________
> > 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
>
> --
> I am free and have a destination too far,
>                       .... I will keep flying.
>
>
___________________________________________________________________________
> 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