I have created a login
java file which works fine, although I want to use "response.sendRedirect(somepage.jsp)" to forward the user on if they are not authorised to view this page.
Although since I am calling this java file from a
servlet, I am getting the error "Cannot forward after response has been committed" when I try to view a page I shouldn't when not logged in.
This is due to me having a "response.sendRedirect()" in the java file and also one in the servlet.
Since there are going to be several servlets using the "check login" script I needed to put it into a separate file so it saves repeating loads of code in each servlet.
How can I do what I have done so it will work correctly?
Thanks
Michael