tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Osamu Hashimoto <...@yha.att.ne.jp>
Subject Re: Small Query
Date Fri, 25 Jul 2003 08:36:28 GMT




 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" <dvnr16@rediffmail.com>
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

    osm@yha.att.ne.jp

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message