----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

Hi all
 in my app i use two instance variable

  String username,chatarea;

by using these variable i  recieve the parameter from html page

  i use these variable in diff method so that i  declare as instance
variable

when two user send diff name at same time ,but it store the same value for
same both session

   i send back an applet to browser in applet i add  these variable in a
list

 but but it store the same user name for both user

 tody i try with HttpSession class but i am unable to solve this



public void doPost(HttpServletRequest req,HttpServletResponse resp)

{


HttpSession session;

session=req.getSession(false);

username=req.getParameter("name");

chatarea=req.getParameter("category");

System.out.println("in put from html page "+chatarea);

System.out.println("name="+username+ind+chatarea);

if(cheackAddVector(username))

{

try

{

System.out.println("in the same name ");

resp.setContentType("text/html");

sout=resp.getOutputStream();

sout.println("<html>");

sout.println("SORRY THIS NAMED USER ALREADY LOGGED");

sout.println("</html>");

}

catch(IOException e22){System.out.println("EXCEption in init "+e22);}

}

else

{

System.out.println("in the servlet first:");

try

{

resp.setContentType("text/html");

resp.sendRedirect("http://202.71.128.48:8080/doc/en/servlets/project/a.html"
);

file://socket=null;

socket=sersocket.accept();

}

catch(Exception e){System.out.println("Exception in socket connection"+e);}

System.out.println("in the above of chatareacode:");

room_name=chatareacode(chatarea);

System.out.println("in the above addvectorelement:");

System.out.println("in the above out:");

String st=getname();


try

{

out=new DataOutputStream(socket.getOutputStream());

out.writeUTF("ouser_name");

out.writeUTF(username);

out.writeUTF("user_room");

out.writeUTF(room_name);

}

catch(IOException egg2r2){

try{

if(socket!=null)

socket.close();

System.out.println("in the EXCEPTION ist catch:");

}

catch(IOException egg22){

System.out.println("in the EXCEPTION 2nd catch:");

}


}


changetotaluser(chatarea);

addvectorelement();//to add name in corr. vector

inwhile(socket);

System.out.println("in the above WHILE LOOP");

}


}



public String getname()

{


String str1;

str1=username;

return(str1);

[EMAIL PROTECTED]




--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to