How to change the root package of a project project Lift?

The "Symply Lift" standard RestHelper example contains code , code.lib and code.model and bootstrap.liftweb.Boot namespace objects. I changed them to mycompany.myproject.code e tc Now the project compiles fine and Jetty starts just fine, but I get the error The Requested URL /my/url was not found on this server when I try to access what used to be work well before refactoring. What can I forget to change? How can I safely change package names?

Changing LiftRules.addToPackages("code") to LiftRules.addToPackages("mycompany.myproject.code") does not help.

UPDATE: I found out that the problem was caused by the fact that I moved bootstrap.liftweb.Boot to mycompany.myproject.bootstrap.liftweb.Boot . I moved it back and it works again and works. But I'm still wondering how I can configure the location of bootstrap.liftweb as the bootstrap.liftweb.Boot class, is different from project to project, and I don't want all of them to have the same full name.

+6
source share
1 answer

You can define your own Boot class using the LiftFilter Setup in web.xml , as described in Chapter 3.2 Bootstrap Learning the Elevator .

From book:

 <filter> ... filter setup here ... <init-param> <param-name>bootloader</param-name> <param-value>foo.bar.baz.MyBoot</param-value> </init-param> </filter> 

where your own loading class class should subclass net.liftweb.http.Bootable and implement the Boot method.

+4
source

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


All Articles