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.
Why not? That makes no sense at all. I do this all the time and have never had a problem.Originally posted by Angel J Gama:
Since I'm using a requestDispatcher, I can't use response.setHeader.
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.
No. Where did you hear that?Originally posted by Angel J Gama:
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?
If happen something bad in you life, don't ask God why it happened. Ask for what.
SCJP 5 (80%) - SCWCD 5 (91%) - SCBCD & SCJD coming soon...
The one in which you only do part of what is necessary? Yes, I read that.Originally posted by Angel J Gama:
have you read my post?
Consider Paul's rocket mass heater. |