title: Display an ArrayList on a jsp page
body: <p>I have this CRUD (Create, Read, Update, Delete) project on jsp. I am not using Servlet since I have just one table I created myself.
  I wrote all code regarding display-all-users inside the DB (visualizzaUtenti() method). Still, I just don't know how to invoke the function in the jsp scriplet. Connection with jdbc works fine on my localhost: it is inside an encapsulated class called DBUtiliy. Delete and Insert queries work too. Anyone can help? Here's my code below.</p>
  
  <pre><code>public List&lt;Utente&gt; visualizzaUtenti() {
      List&lt;Utente&gt; utenti = new ArrayList&lt;Utente&gt;();
      try {
          Statement statement = connessione.createStatement();
          ResultSet rs = statement.executeQuery("SELECT * FROM tbldatiutenti");
          while (rs.next()) {
              Utente utente = new Utente();
              utente.setId(rs.getString("id"));
              utente.setNome(rs.getString("nome"));
              utente.setCognome(rs.getString("cognome"));   
              utente.setEmail(rs.getString("email"));
              utente.setGenere(rs.getString("genere"));
              System.out.println("Visualizzazione effettuata");
              utenti.add(utente);
          }
      } catch (SQLException e) {
          e.printStackTrace();
      }
      return utenti;
  }
  </code></pre>
  
  <p>Thanks in advance.</p>