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 tag click
- 8. 如何點擊'<A href' tag in dynamic text box?
- 9. 如何通過<a href tag
- 10. 如何使用$(文件)。在(「點擊..上<a tag?
- 11. 如何對齊下<a href> tag?
- 12. 轉換www。 HTTPS/HTTP到<a tag in text PHP
- 13. 如何用<a href.. in PHP
- 14. 如何在不使用window.open()和<a href="'> in Struts2
- 15. managedObjectContext in Other View
- 16. 我如何可以移動到<a name tag slowly?
- 17. <a href=''> not working on the other pages
- 18. 我在活動上下文的<a href tag which has dynamic values. how to open that url in webview?
- 19. targeting div in other page
- 20. 獲取使用<a href=... in Firefox
- 21. Transform and Pivot in Access to SQL
- 22. 如何處理<a href> inside a button in wordpress
- 23. Iframe to other web side
- 24. 如何只是一個<a tag> using jquery
- 25. 複選框在<a href> tag
- 26. If/else in return tag
- 27. Post form to other controller
- 28. <a href> tag surrounding multiple elements somehow
- 29. <a name> causes content to be pushed up
- 30. IQueryable <a> to ObservableCollection <a>其中a =匿名類型