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 / mohit rana

It's simple just use session (session object).
HttpSession session = request.getSession();
session.setAttribute(String obj);
and get the above value on other container
session.getAttribute(String obj);

Is This Answer Correct ?    16 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between get and post methods?

814


What are the life-cycle methods for a servlet?

748


How can the referrer and the target urls be used in servlet?

752


What is cookie? Why is cookie used?

834


What are some advantages of storing session state in cookies?

813


What's the difference between servlets and applets?

782


How would you create deadlock on your servlet?

866


What are some disadvantages of storing session state in cookies?

817


What is difference between ServletResponse sendRedirect() and RequestDispatcher forward() method?

855


Explain how to improve Servlet Performance?

860


What is the directory structure of a war file?

934


Which exception is thrown if the servlet is not initialized properly?

810


Write a simple servlet program to print the contents of html.

820


What are the supporting protocol by HttpServlet ?

891


Explain the difference between servletconfig and servletcontext in servlet?

796