Hi,
Basically you can't. from the api
forward should be called before the response has been committed to the client (before response body output has been flushed). If the response already has been committed, this method throws an IllegalStateException. Uncommitted output in the response buffer is automatically cleared before the forward.
What does this mean - if you send anything to the client it either causes the forward to throw an
IllegalStateException if what you have sent has already made it to the client OR what you sent to the client is flushed from the buffer and so never makes it to the client.
So what can you do. The easiest thing is to return a page that displays the message and then, through a meta tag or another way (there are several), redirects the browser to the page that you wanted the client to go to.
Or as an alternative return a page that has the message you want to display and as it loads - via javascript it calls the
servlet again which can then do a
HTH Mat