title: displaying resultset values from servlet to jsp page
body: <p>i am fetching the data from database by servlet and then setting it to resultset. Now i want to dislay data on the jsp page. for that i used list to set all data and with jstl i displayed at jsp page. but i am getting two column with same data. 
  Here is the code..</p>
  
  <p><strong>SERVLET CODE:</strong></p>
  
  <pre><code>ResultSet rs = stmt.executeQuery(query);
  
              while (rs.next()) {
  
                  wb.setDeviceAccount(rs.getString("accountID"));
                  wb.setVehicleId(rs.getString("deviceID"));
                  wb.setSimNumber(rs.getString("simID"));
                  wb.setImeiNumber(rs.getString("imeiNumber"));
                  wb.setLastTimestamp(rs.getString("lastGPSTimestamp"));
                  wb.setLastLoginTime(rs.getString("lastUpdateTime"));
                  wb.setExpirationTime(rs.getString("expirationTime"));
                  list.add(wb);
  
              }
              rs.close();
              stmt.close();
              con.close();
              request.setAttribute("deviceList", list);
  
              RequestDispatcher requestDispatcher = request.getRequestDispatcher("/installedDeviceList.jsp");
              requestDispatcher.forward(request, response);
  </code></pre>
  
  <p><strong>JSP PAGE:</strong></p>
  
  <pre><code>&lt;c:forEach items="${deviceList}" var="dList"&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;/td&gt;
                      &lt;td&gt;${dList.deviceAccount}&lt;/td&gt;
                      &lt;td&gt;${dList.vehicleId}&lt;/td&gt;
                      &lt;td&gt;&lt;a href="#" onclick="toggle();"&gt;${dList.simNumber}&lt;/a&gt;&lt;/td&gt;
                      &lt;td&gt;${dList.imeiNumber}&lt;/td&gt;
                      &lt;td&gt;${dList.lastTimestamp}&lt;/td&gt;
                      &lt;td&gt;${dList.lastLoginTime}&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/c:forEach&gt;
  </code></pre>