No description, website, or topics provided.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Lift Filter for use with CloudBees

When running a Lift application on CloudBees the Lift run.mode will default to "development". This servlet filter will set the run.mode based on the value set in the cloudbees-web.xml configuration, defaulting to development if not set.

This means a local container:start will default to development mode, but a CloudBees deployment will default to production mode (or whatever value you put in the WEB-INF/cloudbees-web.xml file).

To use

There are three modifications you need to make to your Lift application based on the contents of this repository.

First, copy the src/main/scala/net.liftmodules.cloudbees.servlet/CloudBeesLiftFilter.scala from this project into your project.

Next, modify your src/main/webapp/WEB-INF/web.xml to remove this line...


...and replace it with this line:


Finally, if you already have src/main/webapp/WEB-INF/cloudbees-web.xml then add the following lines after the appid:


If you don't have a cloudbees-web.xml, copy the example one from this repository.

Bonus step!

You may need to add the Servlet API as a dependency in your SBT build file if you don't already have it:

"javax.servlet" % "servlet-api" % "2.5" % "provided->default"

Running this project

This git repository contains a Lift application. Run it via:

$ sbt
> container:start

Open to see the report: "Your run mode is development".

Run it via a CloudBees on in your local bees environment:

$ sbt package
$ bees app:run ./target/scala-2.9.1/cloudbees-lift-filter_2.9.1-0.1-SNAPSHOT.war

..and it'll report "Your run mode is Production".