【发布时间】:2012-01-23 01:57:16
【问题描述】:
Lift 中的以下类型标签似乎不适合我:
<lift:snippet type="MyClass:render" />
<lift:MyClass.render/>
<lift:MyClass/>
使用这些标签会导致 Class Not Found 错误。如果我尝试使用
调用一个类<div class=lift:myclass.mymethod />
它可以工作。或者,如果我使用 span 标签调用它。例如,Pollak 的 Simply Lift 中的 Hello World 示例对我有用,使用以下代码成功显示了 Howdy 方法:
<span class="lift:helloWorld.howdy">
Welcome to your Lift app at <span id="time">Time goes here</span>
</span>
目前,我的问题来自于尝试在第 13.1 章中实现 Exploring Lift(又名 The Lift Book)OpenID 示例。我已经使用 sbt 以及 lift-openid 库下载了 OpenID4Java。该示例可以在http://exploring.liftweb.net/master/index-13.html 找到。我已经实现了对 Boot 类的更改,并创建了 OpenID 类和 SimpleOpenIDVendor 类。但是创建一个包含
的html文件 <lift:OpenID.form>
<openId:renderForm/>
</lift:OpenID.form>
导致在浏览器中显示以下错误:
Error processing snippet: openid.form
Reason: Class Not Found
XML causing this error:
<lift:openid.form xmlns="http://www.w3.org/1999/xhtml">
<openid:renderform>
</openid:renderform></lift:openid.form>
类 OpenID 被放置在以包代码开头的包中,Lift 会隐式找到该代码。它包含在 Boot.scala 文件中
LiftRules.addToPackages("code")
所以,我很茫然。有什么想法吗?
请注意,其他提升标签,例如 lift:bind-at 和 lift:surround 等都可以正常工作。
【问题讨论】:
-
您的问题可能是新的(er)HTML5 解析器的工作方式。您应该尝试使用
lift:open_id作为标签。 -
看起来就是这样,因为我刚刚找到了 Pollak 的帖子:groups.google.com/forum/#!topic/liftweb/H-xe1uRLW1c
-
并查看this 线程,了解使用 html5 模板时调用 s sn-p 的最新方法。
标签: eclipse scala openid lift sbt