Originally posted by William Brogden:
What is the purpose of creating a Connection?
If you really need to connect to another URL, you should encapsulate creating the connection and getting the data in a helper class, not in a servlet method. That way you can test it outside the servlet environment - MUCH simpler.
watch this pooling of connection using stack,
we have a stack of, say, 10 connections. we have two methods,
now just make your push() and pop() methods threadsafe. so everythread would get a seperate conn object.