This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Can i put Request object in the Session object like this. session.setAttribute("page1", request); after pass 2 page i want to get page1 again i use HttpServletRequest page1 = (HttpServletRequest) session.getAttribute("page1"); Is it work ??
In a round-about way, Andres is saying that no, you can't do that. A request object is only valid until you have sent your response, and that's it. It certainly wouldn't be a good idea to try to hold onto it and do anything with it during rubsequent requests. Dave
One alternative you might want to consider is to use the RequestDispatcher.forward(reqest, response) method from the ServletContext(application). You can wrap your page 2 resource in a RequestDispather object and then forward the request object to page 2. One suggestion. craig.