2013-03-15 21 views
1

我正在使用電梯框架工作。我從github.com下載了一個示例應用程序,並且正在嘗試在其中添加更多行。我在的src/main/webapp的一個index.html的在電梯框架中添加更多頁面和.scala類

<!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"> 
<head><meta content="text/html; charset=UTF-8" http-equiv="content-type" /> <title>Home</title></head> 
<body class="lift:content_id=main"> 
<div id="main" class="lift:surround?with=default;at=content"> 
    <h2>Welcome to your project!</h2> 
    <p> 
<span class="lift:helloWorld.howdy"> 
    Welcome to your Lift app at <span id="time">Time goes here</span> 
</span> 
    </p> 
</div> 
</body> 
</html> 

我試圖添加以下行它

<span class="lift:helloWorld.newHowdy"> 
    Welcome to your Lift app at <span id="newTime"></span> 
</span> 

我在片段文件夾中的HelloWorld類寫的newHowdy方法。但一個錯誤是顯示在瀏覽器中一樣, 錯誤處理代碼段:helloWorld.newHowdy 原因:未找到方法 XML導致此錯誤:

我怎樣才能解決這個問題?以及如何在代碼片段中添加更多頁面和.scala文件並從html頁面訪問它。提前預訂

回答

0

是的,當然,您可以擁有所需的類和html-s。

您是否嚴格複製粘貼「howdy」方法爲「newHowdy」?

另外,標籤應該一個接一個放置,而不是放在裏面。 請問您能分享全新的HTML代碼和代碼片段嗎?

+0

DEF你好= 「#TIME *」 #> date.map(_。的toString) DEF newHowdy = 「#newTime *」 #> 「HII」 的ToString這是我的片斷和

\t <跨度類= 「電梯:helloWorld.howdy」> \t歡迎的隨着時間的流逝這裏 \t \t的 名稱

是我的代碼的一部分 – isc 2013-03-15 12:37:53