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?
0
A
回答
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.
2
When everything is declared in your SiteMap, you can have Lift generate the links for you。
0
也可以做我認爲你問的,這是爲了使鏈接可訪問,但在SiteMap中不可見(如果你根本不需要SiteMap,請使用Brian的答案),代碼像這樣:
SiteMap(Menu("PreClass")/"preClass" >> Hidden)
我們寧願離開SiteMap啓用嚴密控制訪問似乎是一個好主意在我們的情況。
相關問題
- 1. MVC <a href> redirect to other website?
- 2. 如何使用<a href> tag in JTextPane
- 3. 使用<a href= > tag
- 4. <a href in fireforx adds a %1B to the code but works fine with all other browsers?
- 5. 如何使用<a href> tag
- 6. 如何使文本有一個<a ref> tag in business layer in ASP
- 7. 頁面跳轉點擊<a href> tag in IE, jquery is attached to the a href
- 8. 在<a tag click
- 9. 如何點擊'<A href' tag in dynamic text box?
- 10. 如何隱藏<a href> tag in InnerHTML
- 11. 如何通過<a href tag
- 12. 我如何使用expresso/jasmine/<other>
- 13. 如何使用$(文件)。在(「點擊..上<a tag?
- 14. 如何對齊下<a href> tag?
- 15. 如何用<tag></tag>替換[tag] [/ tag]?
- 16. 如何匹配'<a href=' in a string?
- 17. 轉換www。 HTTPS/HTTP到<a tag in text PHP
- 18. 如何用<a href.. in PHP
- 19. 如何使HTML <a target='_parent'> point to the same as javascript window.opener?
- 20. 如何在不使用window.open()和<a href="'> in Struts2
- 21. managedObjectContext in Other View
- 22. Rafer to the other batch in the same folder in 2008 2008
- 23. 我如何可以移動到<a name tag slowly?
- 24. PHP str_replace <tag>東西 - 東西</tag>納入<a href="stuff">Stuff<a href="things">Things?
- 25. 如何刪除<a href> Link Tag for a Specific Value using Jquery
- 26. <a href=''> not working on the other pages
- 27. 我在活動上下文的<a href tag which has dynamic values. how to open that url in webview?
- 28. Transform and Pivot in Access to SQL
- 29. 我應該在F#中使用Nullable <'a>還是Option <'a>?
- 30. targeting div in other page