java - Printing data from db to ftl page using list and iterator -


is there way print 1 data db without using list?

public class displaypoolaction {      private list<pooldescription> data = new arraylist<pooldescription>();      public list<pooldescription> getdata() {         return data;     }      public string execute() throws sqlexception, classnotfoundexception {          displayutilservice du = new displayutilservice();         resultset rs = du.poolname();          while (rs.next()) {             pooldescription pd = new pooldescription(rs.getstring("pool_name"),                     rs.getstring("quiz_id"));             data.add(pd);         }          if (data.size() > 0)             return "success";         return "failure";      }  }  <#include "../../util/base.ftl"> <@base class='display' scripts=[]  styles=["assets/css/style.css"]> <section > <h1>display table information</h1> <form action="poolnameaction" method="post" charset="utf-8"> div class="slider"> <table> <tr> <td>poolname</td> </tr> <@s.iterator value="%{data}"> <tr> <td> <s.property value="%{poolname}" /> </td> </tr> </@s.iterator> </table> </div> <button>click</button> </form> </section> </@base> 

i want display poolnames db. have poolnames in db poolname1, poolname2 etc.

this able display if press poolname1. should go different page using struts can please tell me without using list , iterator how display?


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -