Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/380.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用model和Scriptlet获取价值_Java_Jsp_Jsp Tags - Fatal编程技术网

Java 如何使用model和Scriptlet获取价值

Java 如何使用model和Scriptlet获取价值,java,jsp,jsp-tags,Java,Jsp,Jsp Tags,我正在JSP中创建一个表,其中使用硬代码显示一些值。 我想使用scriptlet和model显示这些值。有人帮我怎么做 <tr> <td>Automobile</td> <td>11-JUN-2015</td> <td>10-FEB-2016</td> <td>Cars and bikes</

我正在JSP中创建一个表,其中使用硬代码显示一些值。 我想使用scriptlet和model显示这些值。有人帮我怎么做

<tr>
             <td>Automobile</td>
             <td>11-JUN-2015</td>
             <td>10-FEB-2016</td>
             <td>Cars and bikes</td>

            </tr>

从数据库中获取值:

<%rst=stmt.executeQuery("select * from auto_details");%>
示例Html表:

<html>
            <body>
            <center>
                <h2>AutoList</h2>
                <table border="1" cellspacing="0" cellpadding ="0">
                <tr>
                    <td><b>S.No</b></td>
                    <td><b>Date</b></td>
                    <td><b>typeofvichele</.b></td>
                </tr>
                    <%
                    int no=1;
                    while(rst.next()){
                    %>
                    <tr>
                      <td><%=no%></td>
                      <td><%=rst.getString("date")%></td>
                      <td> <%=rst.getString("typeofvichele")%> </td>
                    </tr>
                    <%
                    no++;
        }
        rst.close();
        stmt.close();
        con.close();
    %>
                </table>
                </center>
            </body>
        </html>