Updated Lift / Akka Sample

This commit is contained in:
Timothy Perrett 2009-08-05 23:33:06 +01:00
parent a0e6b53d6f
commit 7419c86270
4 changed files with 29 additions and 17 deletions

View file

@ -23,7 +23,7 @@ class Boot {
LiftRules.addToPackages("sample.lift") LiftRules.addToPackages("sample.lift")
LiftRules.httpAuthProtectedResource.prepend { LiftRules.httpAuthProtectedResource.prepend {
case (ParsePath("secure-basic" :: Nil, _, _, _)) => Full(AuthRole("admin")) case (ParsePath("liftcount" :: Nil, _, _, _)) => Full(AuthRole("admin"))
} }
LiftRules.authentication = HttpBasicAuthentication("lift") { LiftRules.authentication = HttpBasicAuthentication("lift") {

View file

@ -1,4 +1,4 @@
package eu.getintheloop.example.snippet package sample.lift.snippet
class HelloWorld { class HelloWorld {
def howdy = <span>Welcome to lift-akka at {new _root_.java.util.Date}</span> def howdy = <span>Welcome to lift-akka at {new _root_.java.util.Date}</span>

View file

@ -1,5 +1,15 @@
<lift:surround with="default" at="content"> <lift:surround with="default" at="content">
<h2>Welcome to your project!</h2> <h2>Welcome to the Akka + Lift Sample</h2>
<p><lift:helloWorld.howdy /></p> <p>This page is served by Lift, and Lift alone. In order to demonstrate how AkkaServlet and <br />
Lift can work in harmony we have supplied a sample JAX-RS service that is secured using <br />
Lift's HTTP Basic Authentication.</p>
<p>To access the Akka service, visit <a href="/liftcount">this url</a> and enter the
following access credentials:</p>
<p>user: <strong>someuser</strong><br />
password: <strong>1234</strong></p>
<p><lift:HelloWorld.howdy /></p>
</lift:surround> </lift:surround>

View file

@ -1,15 +1,17 @@
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:lift="http://liftweb.net/"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:lift="http://liftweb.net/">
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="description" content="" /> <meta name="description" content="" />
<meta name="keywords" content="" /> <meta name="keywords" content="" />
<lift:CSS.blueprint />
<title>eu.getintheloop.example:lift-akka:1.0-SNAPSHOT</title> <title>Akka with Lift Example</title>
<script id="jquery" src="/classpath/jquery.js" type="text/javascript"></script> <script id="jquery" src="/classpath/jquery.js" type="text/javascript"></script>
</head> </head>
<body> <body>
<lift:bind name="content" /> <div class="container">
<lift:Menu.builder /> <lift:bind name="content" />
<lift:msgs/> <lift:Menu.builder />
</body> <lift:msgs/>
</div>
</body>
</html> </html>