[EMAIL PROTECTED] wrote:
> Folks,
>
> A general servlet programming question, rather than one directed
> specifically at Tomcat (are such questions considered wildly offtopic for
> this list?).
>
> Would anyone consider it unwise to write a web application that saved the
> last HttpServletRequest object received by a servlet in the user's session,
> and referred to it in the next request from the client?
>
Saving the request object is certainly possible, but it is not going to
do what
you want. Most servlet containers recycle their request and response
objects
(to avoid creating them every time) on subsequent requests, so the
headers,
parameters, and attributes of that original header are going to get
changed
anyway. In addition, there's no guarantee that the "next" request which
uses
your request object even comes from the same user, so you're going to
end up
scrambling things for all users.
The rule of thumb to always follow: if you want to save anything from
one
request to the next, save those values individually (or in beans) in the
user's
session.
>
> Regards,
> James W.
Craig McClanahan
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets