2010-12-13 56 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.Comment utiliser <a href> tag to access other templates in lift?

Répondre

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

Il est aussi possible de faire ce que je pense que vous avez demandé, rendre le lien accessible, mais pas visible dans SiteMap (si vous ne voulez pas du tout le SiteMap, allez avec la réponse de Brian), avec du code comme ceci:

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

Nous préférons laisser le SiteMap permis que le contrôle étroitement l'accès semble être une bonne idée dans notre cas.