How to divide this DROPDOWN menu codes to servlet, dao and JSP?
<p>i am tring to avoid java code in jsp file. But i couldnt figure the solution. Can anyone help me? </p>

<p>JSP file : </p>

<pre><code>&lt;select&gt;
&lt;%
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
String url="jdbc:oracle:thin:@localhost:1521:xe";
String username="sys as sysdba";
String password="sys";
String query="select lecturerFullname from lecturer";
Connection con=DriverManager.getConnection(url,username,password);
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery(query);
while(rs.next())
{

%&gt;

    &lt;option&gt;&lt;%=rs.getString("lecturerFullname") %&gt;&lt;/option&gt;

        &lt;%

}
%&gt;&lt;/select&gt;
    &lt;/table&gt;
    &lt;%
    rs.close();
    stmt.close();
    con.close();
    }
catch(Exception e)
{
    e.printStackTrace();
    }




%&gt;&lt;/select&gt;
</code></pre>

<p>This is what i tried... <a href="https://stackoverflow.com/questions/35312556/getattribute-returns-null-for-drop-down-list-in-jsp">getAttribute() returns null for drop down list in jsp</a>  but i still couldnt find the solution. Do i have to use JSTL? can i avoid using JSTL hehe... I REALLY REALLY HOPE SOMEONE TO HELP ME. THANK YOU!!!!</p>