jeudi 5 avril 2018

To identify which button is pressed and to get the corresponding data assosiated with it.

When the user clicks on the button, I want to get the mobile no. of the pressed user. The data is stored in an Array List and displayed in a table using for loop.

Technologies used in backend: -JSP -Servlet -JAVA

<%

        ArrayList<HospitalDTO> list=(ArrayList<HospitalDTO>)request.getAttribute("arrayList");
        for(HospitalDTO hsp:list)
        {
            long no=hsp.getNumber();
            //session.setAttribute("contactNumber",no);
            String name=hsp.getName();
            Date nextDD=hsp.getNextDD();
            Date lastDD=hsp.getLastDD();
            out.println("<tr><td class='text-center'>"+no+"</td><td class='text-center'>"+name+"</td><td class='text-center'>"+lastDD+

                    "</td><td class='text-center'>"+nextDD+"</td><td class='text-center'><form action='SendSmsServlet' method='post'><input type='submit' class='btn btn-info' value='Notify Donor'></form></td></tr>");
        }

    %>

Thanks for any support.




Aucun commentaire:

Enregistrer un commentaire