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 is the difference between using getSession(true) and getSession(false) methods?

578


How to read request headers from servlets?

569


What’s the difference between genericservlet and httpservlet?

534


Can we override destroy method in servlet?

508


What is the difference in between the httpservlet and generic servlet?

612






Why is it that we can't give relative URL's when using ServletContext.getRequestDispatcher() when we can use the same while calling ServletRequest.getRequestDispatcher()?

621


What are all the protocols supported by httpservlet?

655


Is it possible to have a constructor inside the servlet?

554


Which method is called when reference variable is passed in system.net?

1838


Can we fetch the attributes related to a servlet on a different servlet?

640


What is webservlet?

539


What do you mean by chaining in servlet?

580


How do you run a servlet?

548


How a servlet is unloaded?

597


What is the difference between Servlets and Applets?

551