Jsp显示数据方法
2013-11-17 16:48
162 查看
数据显示页面
<table>
<logic:iterate id="show" name="product" type="com.michael.pojo.Product">
//id是迭代时的临时变量名称
//name代表了需要迭代的集合(必须类型)来自session或者request的属性,即action传过来formbean名称
//name+property该formbean指定的属性property必须是一个集合类型
//type是实体的路径
<tr>
//获取后台数据方法一,id值.实体的属性方法
<td><%=show.getProduct_price()%></td>
//获取后台数据方法二,直接传递实体属性名
<td>${product_price}</td>
//获取后台数据方法三
//<bean:write/>用来将属性输出,name用来匹配<logic:iterate/>的id,property用来匹配相应类的(实体)属性
<td><bean:write name="show property="procduct_price"/></td>
</tr>
</logic:iterate>
-----------------以上三种方法必须定义logic标签id值------------------
<tr>
//获取后台数据方法四
<td><%=request.getParameter("product_price")%></td>
//获取后台数据方法五,必须引用struts2的<%@
taglib prefix="s" uri="/struts-tags" %>标签
<td><s:property value="product_price"/></td>
//获取后台数据方法六,必须引用<%@ page
isELIgnored="false" %>标签,使用EL表达式
<td>${requestScope.product_price}</td>
</tr>
</table>
<table>
<logic:iterate id="show" name="product" type="com.michael.pojo.Product">
//id是迭代时的临时变量名称
//name代表了需要迭代的集合(必须类型)来自session或者request的属性,即action传过来formbean名称
//name+property该formbean指定的属性property必须是一个集合类型
//type是实体的路径
<tr>
//获取后台数据方法一,id值.实体的属性方法
<td><%=show.getProduct_price()%></td>
//获取后台数据方法二,直接传递实体属性名
<td>${product_price}</td>
//获取后台数据方法三
//<bean:write/>用来将属性输出,name用来匹配<logic:iterate/>的id,property用来匹配相应类的(实体)属性
<td><bean:write name="show property="procduct_price"/></td>
</tr>
</logic:iterate>
-----------------以上三种方法必须定义logic标签id值------------------
<tr>
//获取后台数据方法四
<td><%=request.getParameter("product_price")%></td>
//获取后台数据方法五,必须引用struts2的<%@
taglib prefix="s" uri="/struts-tags" %>标签
<td><s:property value="product_price"/></td>
//获取后台数据方法六,必须引用<%@ page
isELIgnored="false" %>标签,使用EL表达式
<td>${requestScope.product_price}</td>
</tr>
</table>
相关文章推荐
- jsp通过自定义标签库实现数据列表显示的方法
- jsp显示的查询数据,有换行的实现方法
- jsp数据显示方法
- 解决springmvc 从后台获取json数据传入前台jsp中文显示???的方法
- ssh框架里面添加数据时,jsp页面中文输入显示问号?解决方法
- jsp页面访问后台方法显示数据
- jsp通过自定义标签库实现数据列表显示的方法
- 关于ExtJs4提交数据到jsp页面,返回正确的json显示例子。及error:You're trying to decode an invalid JSON String...解决方法
- JSP页面显示乱码解决方法
- javax.swing.JTextArea setText方法让数据换行显示
- 使用mobile jQuery 动态给select下拉添加数据,选中项默认不显示的解决方法。
- 百度地图api在Html中显示,在jsp页面中不显示解决方法
- Linux编程向Mysql插入中文数据显示乱码的解决方法
- Angular2 *ngFor把数据显示在多个input中出错解决方法
- jsp标签中添加数据--jQuery 的append()方法以及.empty()方法
- python中plot实现即时数据动态显示方法
- 定义一个时间类,提供设定时间、显示时间和秒数增加1的功能,其中设定时间的方法需要校验数据的正确性
- 在JSP页面中实现检索数据的分页显示
- DataBind包括三大方法,Repeater,DataList和DataGrid,这些控件都位于 System.Web.UI.WebControls 命名空间中,从 WebControl 基类中直接或间接派生出来的。这些方法都是通过HTML来显示数据的内