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
What is the difference between using getSession(true) and getSession(false) methods?
How to read request headers from servlets?
What’s the difference between genericservlet and httpservlet?
Can we override destroy method in servlet?
What is the difference in between the httpservlet and generic servlet?
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()?
What are all the protocols supported by httpservlet?
Is it possible to have a constructor inside the servlet?
Which method is called when reference variable is passed in system.net?
Can we fetch the attributes related to a servlet on a different servlet?
What is webservlet?
What do you mean by chaining in servlet?
How do you run a servlet?
How a servlet is unloaded?
What is the difference between Servlets and Applets?