Created
August 12, 2009 18:58
-
-
Save eltimn/166669 to your computer and use it in GitHub Desktop.
Settings for using H2 console servlet in a Lift app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To use the H2 console servlet in your Lift app add the following to your web.xml | |
and Boot.scala files. Then you can access it via /console. | |
web.xml: | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE web-app | |
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" | |
"http://java.sun.com/dtd/web-app_2_3.dtd"> | |
<web-app> | |
<filter> | |
<filter-name>LiftFilter</filter-name> | |
<display-name>Lift Filter</display-name> | |
<description>The Filter that intercepts lift calls</description> | |
<filter-class>net.liftweb.http.LiftFilter</filter-class> | |
</filter> | |
<filter-mapping> | |
<filter-name>LiftFilter</filter-name> | |
<url-pattern>/*</url-pattern> | |
</filter-mapping> | |
<servlet> | |
<servlet-name>H2Console</servlet-name> | |
<servlet-class>org.h2.server.web.WebServlet</servlet-class> | |
<load-on-startup>0</load-on-startup> | |
</servlet> | |
<servlet-mapping> | |
<servlet-name>H2Console</servlet-name> | |
<url-pattern>/console/*</url-pattern> | |
</servlet-mapping> | |
</web-app> | |
Boot.scala: | |
// allow /console to fall thru for H2 console servlet | |
LiftRules.liftRequest.append({case r if (r.path.partPath match { | |
case "console" :: _ => true | |
case _ => false} | |
) => false}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment