0

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.

Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95
Tomyrex
  • 3
  • 1
  • 1
    I suppose you mean `Cliente`. Did you import that class? Is it in your classpath when you build your application? – Federico klez Culloca Nov 25 '22 at 14:13
  • Uhmm, I can send you the entire code, but in the practice didnt make me import classes, just that as a "client list, like from a db" (yes, sorry its "Cliente" and "clientes" in spanish) – Tomyrex Nov 25 '22 at 15:02

0 Answers0