使用MVC模式开发程序,完成数据的模糊查询(2)
来源:未知 责任编辑:责任编辑 发表时间:2014-02-18 03:25 点击:次
	   
	<td>姓名</td>
<td>年龄</td>
<td>性别</td>
<td>地址</td>
</tr>
<%
ArrayList arrayList = (ArrayList)request.getAttribute("arrayList");
for(int i=0; i<arrayList.size();i++){
Student student = (Student)arrayList.get(i);
%>
<tr>
<td><%=student.getId()%></td>
<td><%=student.getName()%></td>
<td><%=student.getAge()%></td>
<td><%=student.getSex()%></td>
<td><%=student.getAddress()%></td>
</tr>
<%
}
%>
</table>
</body>
</html>
[html]
<?xml version="1.0" encoding="UTF-8"?> 
<web-app version="2.4"  
    xmlns="http://java.sun.com/xml/ns/j2ee"  
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee  
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 
  <welcome-file-list> 
    <welcome-file>index.jsp</welcome-file> 
  </welcome-file-list> 
   
    <servlet> 
         <servlet-name>queryServlet</servlet-name>  
         <servlet-class>com.mars.queryServlet</servlet-class>  
    </servlet> 
       
    <servlet-mapping> 
        <servlet-name>queryServlet</servlet-name>  
        <url-pattern>/queryServlet</url-pattern>  
    </servlet-mapping> 
   
</web-app> 
相关新闻>>
- 发表评论
- 
				
- 最新评论 进入详细评论页>>


