action层返回一个对象的List格式,比如如下代码:
List<Structure> structures = structureService.getAllStructures();
在JSP页面中代码为:
<%@ page language="
Java" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/jmesa.tld" prefix="jmesa"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<html>
<head>
<title><spring:message code="chemical.cst" />
</title>
<link href="${pageContext.request.contextPath}/css/jmesa.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/common/jquery-1.2.6.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jmesa.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.jmesa.js"></script>
<script type="text/javascript">
function onInvokeAction(id) {
createHiddenInputFieldsForLimitAndSubmit(id);
}
</script>
</head>
<body>
<form action="${pageContext.request.contextPath}/cst/structures.do" method="post">
<div id="structuresTablePlaceholder">
<jmesa:tableFacade
id="structuresTable"
items="${structures}"
maxRows="10"
maxRowsIncrements="10,20,30"
var="structrue">
<jmesa:htmlTable width="630px">
<jmesa:htmlRow>
<jmesa:htmlColumn property="smiles" title="Smiles" filterable="false"/>
<jmesa:htmlColumn property="formula" title="Formula" filterable="false"/>
<jmesa:htmlColumn property="mdlNumber" title="MDL" filterable="false"/>
<jmesa:htmlColumn property="molWeight" title="MW" filterable="false"/>
</jmesa:htmlRow>
</jmesa:htmlTable>
</jmesa:tableFacade>
</div>
</form>
</body>
</html>
posted on 2009-03-04 22:21
周锐 阅读(1026)
评论(3) 编辑 收藏 所属分类:
Ajax