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.
This may be an easy question... I am working with Websphere 7.0, in case it matters.
I am creating a series of servlets which process XML documents. For eaxh XSD I have a different servlet. So, from a client perspective, you need to know the type of data you are working with in order to call the correct servlet to do the work. I want to avoid this.
So, I created a new servlet, whose task is to analyze the incoming XML and call the proper servlet to do the actual work. So, one point of contact for the client.
My problem is that the way I implemented it (using reflection), I have to manage the servlet's life cycle, which I don't want to.
After thinking about it, I realize there are (at least) two ways to do this:
Redirect the requestoto the proper servlet, using a new GET
Ask Websphere to return an (existing) instance of the proper servlet and call its doGet() method appropriately
Any ideas or Web pages I should look at to figure how to to this?