Dear all, I am a neophyte to Java and the IT world, and my school project involves a simple ordering catalog site. What I'm trying to do is generate an order number for a shopper that wants to purchase a product/products from my list. I have no more problems with order generations because I am reusing a bean that interacts with the database. My problem is, when I have saved an order to the database, retrieved the details through a processing page, I always get a NullPointerException upon invocation of the response.sendRedirect() method. This mechanism that I want to use is to display whatever details that I retrieved from my processing page to my add-to-cart page as an output. I can say that there is no problem with my bean because if I try to retrieve the current details from the DB and display it on the process page itself(which is not right because my processing page is supposed to be a background page only), it does work. I guess it's because of my sendRedirect() thing that leaks. Please helppp!
The jsp page (processing or not) does not handle the response. You will always be referring to and modifying the HTTPRequest. You do not want to be performing a sendRedirect anyway, since everything from your request would be removed from the request. What it seems you want to do is put your data into the request, and do a jsp:forward to your second page.