How to pass session values from one servlet container to another servlet container? or how can we get session values of one container in another container?

Answer Posted / vemula bojjanna

by using setAttribute()and getAttribute()
for example list is one variable in one servlet like
List l=new list();
l.add("bujji");
l.add("vemula");
u set this value from this servlet by using
req.setAtribute("list",l);
by using getAtribute() u can use the list value of first
servlet into second servlet like
req.getAtribut(list);

Is This Answer Correct ?    3 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are Servlets?

598


What is meant by Servlet? What are the parameters of service method?

598


How do we go with database connection and log4j integration in servlet?

704


Describe the phases of servlet lifecycle?

633


What are the steps involved in placing a servlet within a package?

591






What are the various ways of session supervision in servlets?

525


Can we use threads in Servlets?

656


Which protocol will be used by browser and servlet to communicate

583


When a client request is sent to the servlet container, how does the container choose which servlet to invoke?

573


Tell us something about servletcontext interface.

628


What do you mean by singlethreadmodel interface?

582


What is servlet container. how it works?

615


What is http servlet? Explain with the help of an example.

581


Difference between doget and dopost?

682


Can filter be used as request or response?

544