我需要做的是将一个标签放入HTML页面中:
<lift:surround with="default" at="content">
<span class="lift:WorkingStatus.print"></span>
</lift:surround>
需要在适当的snippet.*包中设立一个片段类:
class WorkingStatus {
def print():String={return "<table></table>";}
def speak = <span>Hello World</span>
def render = "* *" #> "Hello there in span"
}
这个函数将生成一些html表格字符串,可以在html中显示,比如像 def print()
。
所以,这是一些比较琐碎的事情,在任何情况下我都无法做到。我需要一个Scala类,可以被整合到html页面中的任何位置,例如 - 让我们说 - 用 <jsp:include>
,并且该类应该能够连接外部web服务,获取某些数据列表并生成html,然后将其插入到所需的位置... 够复杂了吧? :)