How to change a Lift project root package?
Asked Answered
O

1

6

A standard "Symply Lift" RestHelper example project features code, code.lib and code.model and bootstrap.liftweb.Boot namespaces. I've changed those to mycompany.myproject.code e t.c. Now the project compiles ok and Jetty starts just fine but I get The Requested URL /my/url was not found on this server error when I try to access what used to work just fine before the refactoring. What may I have forgotten to change? How should I change the packages names safely?

Changing LiftRules.addToPackages("code") to LiftRules.addToPackages("mycompany.myproject.code") doesn't help.

UPDATE: I've found out that the problem was caused by the fact I've moved bootstrap.liftweb.Boot to mycompany.myproject.bootstrap.liftweb.Boot. I've moved it back and it is up and working again. But I am still curious how can I customize bootstrap.liftweb location as bootstrap.liftweb.Boot class differs from project to project and I don't want all of them to have the same full name.

Osorio answered 18/11, 2011 at 3:52 Comment(0)
O
4

You can define your own Boot class using LiftFilter Setup in web.xml as described in Chapter 3.2 Bootstrap of Exploring Lift.

From the 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 custom boot class class must subclass net.liftweb.http.Bootable and implement the boot method.

Oneself answered 18/11, 2011 at 11:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.