次の属性を持つオブジェクトのリストがあります
public class ViewTestCasesBean {
private String testcaseName;
private String subject;
private String description;
private List<TestCaseDetailsBean> testList = new ArrayList<TestCaseDetailsBean>();
// GETTERS AND SETTERS SECTION.......///////
public String getTestcaseName() {
return testcaseName;
}
public void setTestcaseName(String testcaseName) {
this.testcaseName = testcaseName;
}
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public List<TestCaseDetailsBean> getTestList() {
return testList;
}
public void setTestList(List<TestCaseDetailsBean> testList) {
this.testList = testList;
}
}
今、私のアクションコードは...
public String execute() {
detailsList = viewTestCasesTransaction.fetchTestCases();
session.put("testcaseList", detailsList);
if (detailsList.size() > 0) {
return SUCCESS;
}
return ERROR;
}
ここで detailsList は、表示タグで表示される上記オブジェクトのリストです。
私は以下で試しました
<jsp:root version="1.2" xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="urn:jsptld:http://java.sun.com/jstl/core">
<%@page import="org.apache.jasper.tagplugins.jstl.core.Import"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import="java.util.*"%>
<%@ page import="com.harmony.cloud.bean.TestCaseDetailsBean"%>
<%@ page import="com.harmony.cloud.action.ViewTestCasesAction"%>
<%@ page import="java.sql.*"%>
<%@ page isELIgnored="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Test Cases List</title>
</head>
<body>
<%session.getAttribute("testcaseList"); %>
<display:table name="detailsList" id="parent">
<display:column property="testcaseName" />
<display:column property="subject" />
<display:column property="description" title="Comments" />
<c:set var="nestedName"
value="detailsList[${parent_rowNum -1}].testcaseList}" />
<display:table name="${nestedName}" id="child${parent_rowNum}" >
<display:column title="Steps">
</display:table>
</display:column>
<display:setProperty name="paging.banner.placement" value="top" />
</display:table>
</body>
</html>
しかし、次のエラーが発生しました........
org.apache.jasper.JasperException: /testCasesView.jsp (行: 3、列: 3) 要素のコンテンツは、整形式の文字データまたはマークアップで構成されている必要があります。org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:408) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher. java:89) org.apache.jasper.compiler.JspDocumentParser.parse(JspDocumentParser.java:207) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:226) org.apache.jasper.compiler.ParserController. parseDirectives(ParserController.java:119) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:193) org.apache.jasper.compiler.Compiler.compile(Compiler.java:373) org.apache.jasper. compiler.Compiler.compile(Compiler.
コーディングの何が問題になっていますか?