How do I share session between jsp and servlets

Solution for How do I share session between jsp and servlets
is Given Below:

I have two jsp form with each servlet, I want to know how to pass an object from servlet to jsp page to a Servlet. Specifically, I have a form element whose action tag references a servlet. On form submission, I want to embed an object in session object so that it can be dereferenced by servlet.

Here is the servlet which i want to share session object( Reservation object) to “CustomerFormPage.jsp”

toContractFormServlet.java

    try {
            request.setCharacterEncoding("UTF-8");
            String date1=request.getParameter("departureDate");
            String comefrom=request.getParameter("comeFrom");
            String cometo=request.getParameter("comeTo");
            String baggage=request.getParameter("baggageComp");
                ContractFormChecker b= new ContractFormChecker();
            
            
            
                //return current request associated with request
                Reservation res=new Reservation();
                
                res.setDepartureDate(date1);
                
                res.setComeFrom(comefrom);
                
                res.setComeTo(cometo);
                
                res.setBaggageComp(baggage);
                
                if(b.check(res)==null) {
                
                HttpSession session=request.getSession();
                    
                session.setAttribute("Reservation", res);
                
                request.setAttribute("Reservation", res);
            
                page="CustomerFormPage.jsp";

Here i set session “Reservation” by setAtribute to next page “CustomerFormPage.jsp”

CustomerFormPage.jsp

      <form action="toCustomerFormServlet" method="post">
      <input type="hidden" name="res" value="${sessionScope.Reservation}" />
        <table style="with: 50%">
            <tr>
                <td>name</td>
                <td><input type="text" name="customer_name"
    placeholder="ex" value="">
        </td>
            </tr>
            <tr>
                <td>phone</td>
                
                <td><input type="text" name="phone_num"
    placeholder="ex" value="">
                </td>
            </tr>
            </table>
            
        <a href="ContractFormPage.jsp"><input type="button" value="back" /></a>
        <input type="submit" value="予約" />
        </form>
        
        <div align="center" style="color:red;">
        <p>
        <c:out value="${requestScope.error}"/>
        </p>
        
        
        <p> <span style="color: #FF0000">${sessionScope.Reservation}</span></p>
        </div>
        
        

i checked the session in ${sessionScope.Reservation}, it produce reservation object from session before and i try to set session in the value hidden input type as string for next toCustomerFormServlet

   <input type="hidden" name="res" value="${sessionScope.Reservation}" />

toCustomerFormServlet

    try {
            request.setCharacterEncoding("UTF-8");
            String Customer_name=request.getParameter("customer_name");
            String Customer_phone_no=request.getParameter("customer_phone_no");
            
                String a=request.getParameter("res");
                
                HttpSession session=request.getSession();
                //return current request associated with request
                Reservation rsv=new Reservation();
                
                rsv ab=(Reservation) session.getAttribute(request.getParameter("res"));
                //here produce null in ab , why?

                rsv.setCustomerName(Customer_name);
                rsv.setCustomerPhoneNo(Customer_phone_no);
                
                CustomerFormChecker b= new CustomerFormChecker();

here I got null when i tried to get session from before in rsv ab . how can i fix this?