Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change a Lift project root package?

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.

like image 489
Ivan Avatar asked Nov 18 '11 03:11

Ivan


People also ask

How do I change the root directory in IntelliJ?

From the main menu, select File | Project Structure Ctrl+Alt+Shift+S and click Project Settings | Modules. Select the necessary module and then open the Sources tab in the right-hand part of the dialog. Click Add Content Root and specify the folder that you want to add as a new content root.

How do I change the project path in PyCharm?

Open the Project Structure settings. In the Projects pane of the Project Structure page, click the project you want to configure content roots for. In the dialog that opens, locate the desired directory and click OK.

Can I delete the .idea folder?

There is no problem in deleting this. It's not only the WebStorm IDE creating this file, but also PhpStorm and all other of JetBrains' IDEs. It is safe to delete it but if your project is from GitLab or GitHub then you will see a warning.

How do I edit a project in PyCharm?

Switching between projects To switch between open projects, you can use the following commands of the Window menu: Window | Next Project Window Ctrl+Alt+] Window | Previous Project Window Ctrl+Alt+[


1 Answers

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.

like image 183
Silas Avatar answered Oct 11 '22 17:10

Silas