how to fix Cannot call sendRedirect() after the response has been committed?
you have already forwarded the response in catch block: so, you can not again call the : because it is already forwarded (committed). So what you can do is: keep a string to assign where you need to forward the response.