2010-12-13 33 views
0

According the Lift wiki, I know the "View First" concept of Lift. That's very different from any framework I used. Take the basic JSP things as the example, I could write
<a href="post/new"> Create a new post</a> in the page, and write the logic in a servlet. How can I do things like this with lift? I wrote the same tag in a template and when I accessed this page I got 404 error. But if I add a Menu to the SiteMap, things goes well. Is there any possible to make a link without making a new Menu? I am a beginner of Lift and Scala. Thanks in advance.<a href> tag to access other templates in lift?

答えて

1

Yes, it is possible.

Just don't call LiftRules.setSiteMap at your boot class, then Lift will let you access every pages under your webapp/ directory. You could test your code in this mode.

But this will also lead to no access control, so be careful.

0

リンクをアクセス可能にするが、サイトマップには表示されないようにすることもできます(サイトマップを使用したくない場合は、ブライアンの答えになる)

SiteMap(Menu("PreClass")/"preClass" >> Hidden) 

サイトマップを有効にしたままにしておくと、アクセスを厳重に管理する方が良いと思われます。

関連する問題