论坛首页 入门技术论坛

第一个tapestry实例出错了

浏览 4325 次
该帖已经被评为新手帖
作者 正文
   发表时间:2007-03-01  

今天做了第一个tapestry的例子,只是一个简单入门的例子。

我写一个Home.html代码如下:

java 代码

 

xml 代码
  1. <html>  
  2. <head>  
  3. head>  
  4. <body>  
  5.    hello <span jwcid="subject">world!span>!   
  6. body>  
  7. html>  




他的Home.page代码是:

xml 代码
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <!DOCTYPE page-specification PUBLIC   
  3.   "-//Apache Software Foundation//Tapestry Specification 4.0//EN"   
  4.   "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">  
  5. <!-- generated by Spindle, http://spindle.sourceforge.net -->  
  6.   
  7. <page-specification class="com.ttdev.helloworld.Home">  
  8.     <component id="subject" type="Insert">  
  9.           <binding name="value" value="greetingSubject"/>  
  10.     </component>    
  11. </page-specification>  


  <component id="subject" type="Insert">    </component>

Home.java代码是:

java 代码

 

  1. package com.ttdev.helloworld;   
  2. import org.apache.tapestry.html.BasePage;   
  3.   
  4. public class Home extends BasePage {   
  5.     public String getGreetingSubject() {   
  6.         return "john";   
  7.     }   
  8.   
  9. }   


发布到tomcat里面却是发生错误的:

<!----> documentLocation:
org.apache.tapestry.ApplicationRuntimeException
Could not parse specification context:/WEB-INF/Home.page.
 
org.apache.tapestry.util.xml.DocumentParseException
Unable to read context:/WEB-INF/Home.page: Connection timed out: connect
context:/WEB-INF/Home.page

请大家来看一看,帮一下忙,看看出的是什么错误,新书,请见谅!

   发表时间:2007-03-01  
ecplise里面提示错误说:
Tag <span> on line 7 references unknown component id 'subject'.
但是我不是已经在Home.page里面声明了么?
0 请登录后投票
   发表时间:2007-03-05  
<span jwcid="subject">world!span>!   
这里有问题,span没有正确关闭!
0 请登录后投票
   发表时间:2007-03-11  
谢谢!呵呵,这么弱智的问题,汗啊
0 请登录后投票
论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics