I was doing an exercise in a course that I am taking and I had this problem.
The idea is a JSP that asks for your data and a button to go to another JSP where it shows you the already registered clients (all test, the given result is an arraylist previously created in the servlet).
I leave you the part of the code that gives me an error, which is in the Servlet, when creating a list and its elements.
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
List<Cliente> listaClientes = new ArrayList<> ();
listaClientes.add(new Cliente("12345678", "Luisina", "de Paula", "444222357"));
listaClientes.add(new Cliente("46325965", "Avril", "Lavigne", "774568931"));
listaClientes.add(new Cliente("69584123", "Gianluigi", "Guidicci", "4567531654"));
HttpSession misession = request.getSession();
misession.setAttribute("listaClientes", listaClientes);
response.sendRedirect("MostrarJSP.jsp");
processRequest(request, response);
}
I tried this way since it is as the course tells me, but it keeps giving me an error in the "Client" saying cannot find symbol. I'm starting with Java and I don't know where my mistake could be.