關於:Extjs中,請求調用velocity *.vm文件 問題?

我的郵箱:[email protected]

在treeTest.htm 文件中,

MainPanel = function() {
this.urls=[];
this.homePage="pages/testvm.vm";//關鍵的調用,嵌入到extjs框架中。


this.currentUrl=this.homePage;
this.openTab = function(panel, id) {
var o = (typeof panel == "string" ? panel : id || panel.id);
var tab = this.getComponent(o);
if (tab) {
this.setActiveTab(tab);
} else if(typeof panel!="string"){
panel.id = o;
var p = this.add(panel);
this.setActiveTab(p);
}
};
。。。。。。。。


testvm.vm 定義如下:


<div id="center2">


<h1>書的詳細描述</h1>
<a href="$link.setForward("searchEntry")">Search again</a>

<h3>$book.title</h3>

<b>ISBN:</b>$book.isbn<br>
<b>Title:</b>$book.title<br>
<b>Author:</b>$book.author<br>
<b>Price:</b>$book.price<br>
<b>No Pages:</b>$book.pages<br>
<b>Description:</b>$book.description<br>
<b>Publisher:</b>$book.publisher<br>
</div>


但是,部署後,沒有數據返回。運行報以下錯誤:
2008-6-16 11:01:06 org.apache.catalina.core.ApplicationContext log
信息: Velocity [info] ResourceManager : found /pages/testvm.vm with loader org.apache.velocity.tools.view.servlet.WebappLoader
2008-6-16 11:01:06 org.apache.catalina.core.ApplicationContext log
信息: Velocity [warn] org.apache.velocity.runtime.exception.ReferenceException: reference : template = /pages/testvm.vm [line 17,column 21] : $book.title is not a valid reference.
2008-6-16 11:01:06 org.apache.catalina.core.ApplicationContext log
信息: Velocity [warn] org.apache.velocity.runtime.exception.ReferenceException: reference : template = /pages/testvm.vm [line 19,column 29] : $book.isbn is not a valid reference.
2008-6-16 11:01:06 org.apache.catalina.core.ApplicationContext log
信息: Velocity [warn] org.apache.velocity.runtime.exception.ReferenceException: reference : template = /pages/testvm.vm [line 20,column 30] : $book.title is not a valid reference.
2008-6-16 11:01:06 org.apache.catalina.core.ApplicationContext log
信息: Velocity [warn] org.apache.velocity.runtime.exception.ReferenceException: reference : template = /pages/testvm.vm [line 21,column 31] : $book.author is not a valid reference.
2008-6-16 11:01:06 org.apache.catalina.core.ApplicationContext log
信息: Velocity [warn] org.apache.velocity.runtime.exception.ReferenceException: reference : template = /pages/testvm.vm [line 22,column 30] : $book.price is not a valid reference.
2008-6-16 11:01:06 org.apache.catalina.core.ApplicationContext log
信息: Velocity [warn] org.apache.velocity.runtime.exception.ReferenceException: reference : template = /pages/testvm.vm [line 23,column 33] : $book.pages is not a valid reference.
2008-6-16 11:01:06 org.apache.catalina.core.ApplicationContext log
信息: Velocity [warn] org.apache.velocity.runtime.exception.ReferenceException: reference : template = /pages/testvm.vm [line 24,column 36] : $book.description is not a valid reference.
2008-6-16 11:01:06 org.apache.catalina.core.ApplicationContext log
信息: Velocity [warn] org.apache.velocity.runtime.exception.ReferenceException: reference : template = /pages/testvm.vm [line 25,column 34] : $book.publisher is not a valid reference.


不知道,爲什麼找不到路徑,還請用的朋友,指點一下,謝謝:)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章