The Middling Tale
Order of elements in web.xml is very important. So when you go to create your second 'couplet', make sure all your <servlet> tags are declared before your <servlet-mapping> tags. You'll maybe want to keep the 'couplets' together, because it will be easier to see which one belongs to which, but don't do it!
Ok, I didn't explain myself... In the servlet I can do response.setHeader and then use requestdispatcher to forward request and response, but doing that I can't prevent the response from being cache, isn't it?
Since I'm using a requestDispatcher, I can't use response.setHeader.
You are right, but I'm forwarding it (or them: request and response) to another resource, so the response has not been commited yet. Even if I set headers in the response, they won't be commited at this time.
If I understood your question correctly.
the forward and include methods in RequestDispatcher takes response as a parameter.