【问题标题】:Adding more pages and .scala classes in lift framework在 Lift 框架中添加更多页面和 .scala 类
【发布时间】:2013-03-15 20:21:37
【问题描述】:

我正在使用升降框架。我从 github.com 下载了一个示例应用程序,我正在尝试在其中添加更多行。我在 src/main/webapp 中有一个 index.html

<!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>

我在 sn-p 文件夹的 helloworld 类中编写了 newHowdy 方法。但是浏览器中显示了一个错误,例如, 处理 sn-p 时出错:helloWorld.newHowdy 原因:找不到方法 导致此错误的 XML:

我该如何解决这个问题?以及如何在 sn-p 中添加更多页面和 .scala 文件并提前从 html pages..thanx 访问它

【问题讨论】:

    标签: java eclipse scala lift


    【解决方案1】:

    是的,当然,您可以拥有任意数量的类和 html-s。

    您是否严格将“howdy”方法复制粘贴到“newHowdy”?

    另外,标签应该一个接一个地放置,而不是放在里面。 能否请您分享完整的新 HTML 代码和 sn-p 代码?

    【讨论】:

    • def howdy = "#time *" #> date.map(_.toString) def newHowdy = "#newTime *" #>"hii".toString 这是我的 sn-p 和 欢迎使用您的 Lift 应用程序 时间到了 这里的名字 是我的html代码部分
    猜你喜欢
    • 2011-02-22
    • 2013-03-07
    • 1970-01-01
    • 2011-04-26
    • 1970-01-01
    • 1970-01-01
    • 2010-10-18
    • 2010-09-12
    • 2011-04-26
    相关资源
    最近更新 更多