So here is the problem
I have a connection form sending a Post request to servlet.
this servlet forwards the request to different pages after doing some tests (password, email verification of user).
Only problem is I get the correct page as a response when looking at my POSTrequest but the page doesn't display in my web browser. How come?
Here's my code.
sign in servlet
package AHSServlets;
import java.io.IOException;
import objMetier.signInForm;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import AHSbeans.User;
@WebServlet(
    name = "signInServ",
    urlPatterns = {"/"}
)
public class signInServ extends HttpServlet{
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    {
        this.getServletContext().getRequestDispatcher("/signIn.jsp").forward(request, response);;
    }
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    {
        signInForm connect = new signInForm();
        User user = connect.validateSignIn(request);
        HttpSession session = request.getSession();
        if (user != null) {
            request.setAttribute("connect", connect);
            session.setAttribute("sessionUser", user);
            this.getServletContext().getRequestDispatcher("/restrict_client/client.jsp").forward(request, response);
        }
        else
        {
         request.setAttribute("connect", connect);
         this.getServletContext().getRequestDispatcher("/signIn.jsp").forward(request, response);
        }
    }
}
signIn.jsp
<%@ page pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.min.js" integrity="sha256-QRJz3b0/ZZC4ilKmBRRjY0MgnVhQ+RR1tpWLYaRRjSo=" crossorigin="anonymous"></script>
    </head>
    <body ng-App="AHS" ng-controller="myCtrl">
        <form ng-submit="submitForm()">
            <div>
                <input type="text" ng-model="userObj.mail" placeholder="email"/>
            </div>
            <div>
                <input type="password" ng-model="userObj.password" placeholder="password">
            </div>
            <div>
                <button type="submit">Connect</button>
            </div>
        </form>
        <div>
            <span>${connect.error}</span>
        </div>
        <script type="text/javascript">
            var app = angular.module("AHS", []);
            app.controller("myCtrl", function ($scope, $http, $httpParamSerializerJQLike){
                $scope.userObj = {
                        mail: "",
                        password: "",
                }
                $scope.submitForm = function() {
                      $http({
                         method : 'POST',
                         url : '/', // use relative
                         data: $httpParamSerializerJQLike($scope.userObj),
                         headers: {
                           'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8;'
                         }
                      });
                    };
            });
        </script>
    </body>
</html>
signIn class
package objMetier;
import javax.servlet.http.HttpServletRequest;
import AHSbeans.User;
public class signInForm {
    private String EMAIL_FIELD = "email";
    private String PASSWORD_FIELD = "password";
    private String error = "Default";
    public String getError()
    {
        return (this.error);
    }
    public User validateSignIn(HttpServletRequest request){
        if(request.getParameter("password").isEmpty())
        {
            this.error = "wrong password";
            return (null);
        }
        User user = new User();
        user.setEmail("test@hotmail.com");
        this.error = "connected";
        return (user);
    }
}
As you can see in the signIn.jsp I have ${connect.error} supposed to show me the error message. I repeat myself but I can see this message displayed using debugger but not on my web browser. So what happens is after POST it stays on the web page path and I get the HTML only in the response.
EDIT
here is a screenshot

 
    