I want to covert the scriptlet part into java classes.
Basically, there would be two classes consisting of the entity classes and the other class containing the method. The entity class contains all the table elements.
<%@page import="java.sql.*"%>
<%@page import="connection.Dbconnect"%>
<%@page session="true" %>
<div id="page" class="container">
<div id="content">
<%
String user = session.getAttribute("username").toString();
ResultSet rs=null;
ResultSet rs1=null;
String s1,s2,s3,s4,s5,s6,s7;
try{
Connection con=Dbconnect.getconnection();
Statement st = con.createStatement();
Statement st2 = con.createStatement();
rs=st.executeQuery("select * from user where user_name = '"+user+"'");
if ( rs.next() ){
s1 = rs.getString(1);
s2 = rs.getString(2);
s3 = rs.getString(3);
s4 = rs.getString(4);
s5 = rs.getString(5);
s6 = rs.getString(6);
s7 = rs.getString(7);
%>
<div class="title">
<h2> <%=s4%> </h2>
<h2> My Issues</h2>
<span class="byline"><p><b><a href="assignissue.jsp" rel="nofollow">Assign Issues</a></b></p></span>
</div>
<div class= "spltable">
<table border-bottom=1 align=center style="text-align:center">
<thead>
<tr>
<th>Issue ID</th>
<th>Subject</th>
<th>Description</th>
<th>Department</th>
<th>Date</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<%
rs1 = st2.executeQuery("select * from issue where user_id = '"+s5+"'");
while(rs1.next()){
%>
<tr>
<td><%= rs1.getString(1) %></td>
<td><%= rs1.getString(2) %></td>
<td align="justify"><%= rs1.getString(3) %></td>
<td><%= rs1.getString(10) %></td>
<td><%= rs1.getString(14) %></td>
<td><%= rs1.getString(7) %></td>
</tr>
<% } %>
</tbody>
</table>
</div>
</div>
</div>
</div>
<%
}
}
catch(Exception e) {
out.println(e.getMessage());
}
%>