This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have a servlet and in order to maintain thread-safety, I've removed all the instance variables from it. I have multiple methods in this servlet. The request parameters and their values must be shared among these methods. This servlet wouldn't forward the response to any jsp/servlet. Instead, it generates a xml file which is directly written to the response's output stream. Right now, I am using request attributes to share the information between different methods of the same servlet. Is this a good approach? Are there any other alternative ways that I'm missing? I read, request attributes are used in combination with RequestDispatcher. However, I don't need any RequestDispatcher. Does my approach make sense? Could you please guide me?
As far as I remember (somebody fix me if i'm wrong!), the container creates new Request and Response objects before it gets to the Servlet's service() method (just before assigning new thread to this request).
After the response is sent to the client, the thread finishes and Response and Request objects are eligible for GC.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com