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
周銳 閱讀(1048)
評論(3) 編輯 收藏 所屬分類:
Ajax