I am trying get response from servlet use
request.setAttribute(error, error);
request.getRequestDispatcher("http://localhost:8080/redicted_test/Home.jsp").forward(request, response);
String redictedURL="http://localhost:8080/redicted_test/Home.jsp";
response.sendRedirect(redictedURL);
But get error
java.lang.IllegalStateException: Cannot call sendRedirect() after the response has been committed
Im understand that im send response twice, but how i can do it else?
Can u tell me simplest way?
You already have forwarded the request and now you are redirecting it
If you want to set some attributes from servlet and need to display it on jsp, then just forward the request to jsp and display those attributes