[Tapestry4] tapestry开发指南中水果店例子抛出Component Foreach not found in Namespace错误

nextw3 2007-02-02
我参照《tapestry4开发指南》中水果店的例子写好了shop.page文件,服务运行后却抛出了Component 'Foreach' not found in Namespace错误。我的shop.page文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE page-specification PUBLIC
  "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
  "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">

<page-specification>
<property name="book"/>   
    <component id="bookListLoop" type="Foreach">
        <binding name="source" value="bookList"/>
        <binding name="value" value="book"/>
        <binding name="element" value="literal:tr"/>
    </component>   
    <component id="bookName" type="Insert">
        <binding name="value" value="book.bookName"/>
    </component>
    <component id="bookPrice" type="Insert">
        <binding name="value" value="book.price"/>
    </component>   
</page-specification>

而出错的地方就是<component id="bookListLoop" type="Foreach">这行,我刚刚开始学习tapestry。请看看。
tapestry 2007-02-02
你用的什么版本,
Foreach组件说明里有下面一句话
This component has been deprecated; Tapestry 4.0 adds the For component which replaces Foreach and ListEdit components.
就是说T4.0.x版本中还存在,但是已经deprecated。T4.1中已经没有这个组件了,你把Foreach换成For试一下。
nextw3 2007-02-02
谢谢你,改成了For后果然能用了。真是太谢谢你了~
看来以后我也要仔细看看文档了~
nextw3 2007-02-02
对了,我的tapestry的版本是4.1.1的。果然是这个问题!
Global site tag (gtag.js) - Google Analytics