Im trying to implement role based user access in a system that Im building .Im plugged in some code into a filter that maps across all the secure pages , which is helping me do so.I just check whether a user has the required role to access a particular page , if not I redirect the person to a home page . However in pages , where Im already forwarding through a servlet during page load , I get an error saying that the response has already been committed.
Any ideas on how I could circumvent this ?
This happens when you are trying to use the Response stream that has already been comitted.
For e.g when you are doing response.redirect(new html) , you should not have committed the response while doing this.
HttpServletResponse API will tell you which all methods if invoked on Response object commits the response.