English 中文(简体)
拟在现场地图上使用的Loc模板
原标题:Define template to be used in a Loc in sitemap
  • 时间:2012-01-12 16:06:52
  •  标签:
  • scala
  • lift

利用现场地图,我们可以确定某些途径,在固定配对前线工作,并允许申请分胎。 我要具体指出,所有低于特定道路的要求都采用某种模板。 因此,我谨:

Menu(Loc("show_theme", Link("show" :: "theme" :: Nil, true, "/show/theme"), "Show Theme") )

a. 收集所有要求/show/theme/*(的确如此),但利用模板/show/theme(它没有)服务

我想(例如)/show/theme/1利用该模板/show/theme,以及该模板中的氮,将 出Req。

这是可能的吗? 或者,我做的是错事吗? 此时此刻,Im使用/show_theme? 专题=1,但这是一个微不足道的,很难以形式开展工作。

EDIT:I m试图摆脱利用农业研究小组的寄生虫来编码,并将之作为道路结构的一部分。

最佳回答

Loc代表一个页和一个模板。 如果你想要把多卢拉绘制到洛茨,比你想用重提卢拉重写。 例如:

LiftRules.statefulRewrite.append {

  case RewriteRequest(ParsePath("show" :: "theme" :: theme :: Nil, _, _, _), _, _) =>
    RewriteResponse(ParsePath("show_theme" :: Nil, "", true, false), Map("theme" -> theme), false)

}

怎么做,与要求/show/theme/* 相匹配,并将之改写到/show_theme? 主题=专题}。 你们创立了你的Loc,以回应URL,你可以把主题变数作为问答参数(S.param(“theme”)。

说明:你可以更简明的方式利用洛茨·瓦卢,但我认为,了解在场面上出现的情况是好事。

如果你们需要更多的帮助,我建议你向以下网站发出信息:Lift/2009/3 Group。 我认为,你会找到比你对SO更迅速的答复。

问题回答

暂无回答




相关问题
How to flatten a List of different types in Scala?

I have 4 elements:List[List[Object]] (Objects are different in each element) that I want to zip so that I can have a List[List[obj1],List[obj2],List[obj3],List[obj4]] I tried to zip them and I ...

To use or not to use Scala for new Java projects? [closed]

I m impressed with Twitter and investigating to use Scala for a new large scale web project with Hibernate and Wicket. What do you think about Scala, and should I use it instead of Java? EDIT: And, ...

Why does Scala create a ~/tmp directory when I run a script?

When I execute a Scala script from the command line, a directory named "tmp" is created in my home directory. It is always empty, so I simply deleted it without any apparent problem. Of course, when I ...

Include jar file in Scala interpreter

Is it possible to include a jar file run running the Scala interpreter? My code is working when I compile from scalac: scalac script.scala -classpath *.jar But I would like to be able to include a ...

Scala and tail recursion

There are various answers on Stack Overflow which explain the conditions under which tail recursion is possible in Scala. I understand the limitations and how and where I can take advantage of tail ...

热门标签