How to add a new page to the Lift frame

How to add a new page to the webapp directory in an elevator that a user can access?

Currently, index.html can only be accessed via http: // localhost: 8080 / or http: // localhost: 8080 / index.html

Let's say I add a static newpage.html file to the webapp directory, and what can I do so that users can access it through http: // localhost: 8080 / newpage.html

+3
source share
1 answer

It has been a long time since I did something with Lift, but from what I remember, the easiest way could be to add a page to the menu entries in the bootstrap.liftweb.Boot.scala class. If you set up your project using one of the Lift maven archetypes, this class should be in your project. There is the following line in this class (or something similar to it, the example I received still uses Lift 1.0, currently I believe that they are already going to release 2.0):


// Build SiteMap
val entries = Menu(Loc("Home", List("index"), "Home")) :: Nil

If you change this line to the following:


val entries = Menu(Loc("Home", List("index"), "Home")) :: Menu(Loc("Welcome", List("welcome"), "Welcome")) :: Nil

how you can get your welcome page directly.

+7
source

Source: https://habr.com/ru/post/1746655/


All Articles