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

Who is responsible to create the object of servlet?

946


What are Servlets?

853


Write a program to show the functionality of servlets.

768


What is the difference between get and post methods?

806


What is api in servlet?

772


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

899


How to get the server information in a servlet?

915


Why is servlet used?

918


What is a cookie What is the difference between session and cookie

837


What do you mean by cgi in servlet?

828


How can we achieve transport layer security for our web application?

803


What is session tracking?

921


Explain in brief the directory structure of a web application?

822


Can we override destroy method in servlet?

736


What is meant by session? Tell me something about httpsession class?

807