[Seasar-user:9453] [Teeda]foreachのネスト

fujihara [E-MAIL ADDRESS DELETED]
2007年 7月 25日 (水) 22:00:32 JST


fujiharaです。

Churaプロジェクト(Teeda1.07+S2DAO1.0.43)で社内システムを
構築しています。

以下のようなHTMLに対応するPageクラスはどの様に書くのでしょうか?
------------------HTML-----------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:te="http://www.seasar.org/teeda/extension">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>foreachNest</title>
<link rel="stylesheet" type="text/css" href="../../css/global.css" />
</head>
<body>
<form id="form">
<input type="hidden" id="aaaItemsItemsSave"/>
<table border="1">
 <div id="aaaItemsItems">
 <tr>
  <td><span id="bar">aaa</span></td>
     <div id="aaaItems">
     <tr>
   <td><input type="text" id="foo"/></td>
  </tr>
  </div>
 </tr>
 </div>
</table>
<input type="submit" value="submit"/>
</form>
</body>
</html>
---------------------------------------------------------------

---------------------Pageクラス-----------------------------
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class ForeachNestPage {

 private int aaaIndex;

 private int aaaIndexIndex;

 private List aaaItems;

 private List aaaItemsItems;

 private String bar;

 private String foo;

 public int getAaaIndex() {
  return aaaIndex;
 }

 public void setAaaIndex(int aaaIndex) {
  this.aaaIndex = aaaIndex;
 }

 public int getAaaIndexIndex() {
  return aaaIndexIndex;
 }

 public void setAaaIndexIndex(int aaaIndexIndex) {
  this.aaaIndexIndex = aaaIndexIndex;
 }

 public List getAaaItems() {
  return aaaItems;
 }

 public void setAaaItems(List aaaItems) {
  this.aaaItems = aaaItems;
 }

 public List getAaaItemsItems() {
  return aaaItemsItems;
 }

 public void setAaaItemsItems(List aaaItemsItems) {
  this.aaaItemsItems = aaaItemsItems;
 }

 public String getBar() {
  return bar;
 }

 public void setBar(String bar) {
  this.bar = bar;
 }

 public String getFoo() {
  return foo;
 }

 public void setFoo(String foo) {
  this.foo = foo;
 }

 public Class initialize() {
  return null;
 }

 public Class prerender() {
  List bbbItemsItems = new ArrayList<BarDto>();
  System.out.println("---------------------------");
  for (Integer i = 0; i < 5; i++) {
   BarDto bbbItem = new BarDto();
/*   aaaItems.setBar(i.toString());*/
   for (Integer j = 0; j < 4; j++) {
    System.out.println("ij=" + i.toString() + j.toString());
    FooDto foItem = new FooDto();
/*    foItem.setBar("No." + i.toString());*/
    foItem.setFoo(i.toString() + j.toString());
    bbbItem.getAaaItems().add(foItem);
    bbbItem.setBar(i.toString());
   }
   System.out.println("---------------------------");
   bbbItemsItems.add(bbbItem);
  }
  aaaItemsItems = bbbItemsItems;
  System.out.println("---------------------------");
  return null;
 }

 public static final class BarDto implements Serializable {
  private String bar;
  List    aaaItems = new ArrayList();

  public String getBar() {
   return bar;
  }

  public void setBar(String bar) {
   this.bar = bar;
  }

  public List getAaaItems() {
   return aaaItems;
  }

  public void setAaaItems(List aaaItems) {
   this.aaaItems = aaaItems;
  }
 }

 public static final class FooDto implements Serializable {

  private static final long serialVersionUID = 1L;

  private String foo;

  public String getFoo() {
   return foo;
  }

  public void setFoo(String foo) {
   this.foo = foo;
  }

 }
}
---------------------------------------------------------------
[ESSR0059]クラス(jp.co.gihyo.javaexpert.todo.web.todo.ForeachNestPage$$EnhancedByS2AOP$$b34bf3)のプロパティ(aaaItems)の設定に失敗しました。理由はjava.lang.IllegalArgumentException: argument type mismatch

Teeda-html-exampleの/view/foreach/foreachNest.htmlを
参考にしてるのですがうまくいきません。 



Seasar-user メーリングリストの案内