This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
Hi, I am using the following code (in my servlet) for forwarding request to another page but whatever attributes being set before forwarding the request are getting lost. Could any body please point me out what I am doing wrong? Also whats the difference if I get Request dispatcher from HttpServletRequest rather than ServletContext ?
Joined: Jul 30, 2001
I got it. I am using getParameter to retrieve values in JSP which is causing all the problem. But still do point out whats the differenece in getting RequestDispatcher from SevletContext / HttpServletRequest ? Regards, Vijay
Hello , I feel the data is getting lost because session is getting invalidated as the session id is not being passed by the first servlet to the next servlet. u before u farward the url attach the session id to it . u can do it by calling encodeURL method of HttpServletResponse class
Try and Try Till u succeed<br /> <br />Sandeep Jain
Vijay: getRequestDispatcher(String URL) in ServletContext - takes an absolute URL as an argument where as the method in HttpServletRequest takes an argument which can be either an absolute URL or a relative URL
Vijay Kashyap wrote:I got it. I am using getParameter to retrieve values in JSP which is causing all the problem. But still do point out whats the differenece in getting RequestDispatcher from SevletContext / HttpServletRequest ?