Hello, from Japan.
 
 You must write like this. Try it.

 HttpSessionContext hsc=session.getSessionContext();
 out.println(hsc+"SessionId"+session.getId()+"");
 Enumeration e= hsc.getIds();
 out.println(e);
//out.println("
//"+e.nextElement());
 out.println("Session ID's");
 while(e.hasMoreElements())
 {
 out.println("Session ID's"+(String)e.nextElement());
 }


 Your code shown below is bit mistaken.
 

>  HttpSessionContext hsc=session.getSessionContext();
>  out.println(hsc+"
>  SessionId"+session.getId()+"");
>  Enumeration e= hsc.getIds();
>  out.println(e);
> //out.println("
>  "+e.nextElement());
>  out.println("Session ID's");
>  while(e.hasMoreElements())
>  {
>  out.println("Session ID's"+(String)e.nextElement());
>  }

----- Original Message ----- 
From: "dulipalla narayana rao" <[EMAIL PROTECTED]>
Subject: Small Query


> Hi,
>     I am Narayna Rao,  I am a fresh graduate who is learning 
> servlets and JSP.  I faced a small problem in JSP.  In Orierly 
> book they written that we can find out the number of session are 
> active for a given application using following code.
> 
>      HttpSessionContext hsc=session.getSessionContext();
>      out.println(hsc+"<br>SessionId"+session.getId()+"<br>");
>      Enumeration e= hsc.getIds();
>      out.println(e);
>      //out.println("<br>"+e.nextElement());
>      out.println("Session ID's");
>      while(e.hasMoreElements())
>      {
>          out.println("Session ID's"+(String)e.nextElement());
>      }
> 
> But I am not geting not a Single Session Id, even though there are 
> 3 session are active in Manager list of Tomcat.  Plz let me know 
> why this is happening.
> 
> Actually there is no body to help me in this context, and i have 
> only one book with me.
> 
> Please Help me.
> 
> Yours Sincerly,
> Rao


    Osamu Hashimoto

    [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to