lift

Setting / changing the default (“index”) page in a LiftWeb app

為{幸葍}努か 提交于 2019-12-08 08:59:30
问题 I've googled like crazy but can't find an answer to this. How do I change the page displayed for http://www.mydomain.com/ ? (Right after the web app is created the page defaults to index.html . I'd like to change this!) 回答1: You can't change it. Lift converts the request for "/" to List("index"). Any "blank" part of the request path is converted into "index". Thus, the "index.html" template will be used to serve "/index" and "/". 来源: https://stackoverflow.com/questions/6525039/setting

Scala - Lift - map a custom boxed object for bind?

霸气de小男生 提交于 2019-12-08 07:02:32
问题 Ok, so i have a custom object that is a myUser. myUser looks like this : username:String = "" firstname:String = "" lastname:String = "" I have a list of these users that come into a page, I've made a link to view the details of each user. When you click on a user, it will fill the boxed object that I have as a request var, and then direct to the detail page to view this user information. Why is that I can't bind from a map on this object? Here is some code... private object selectedUser

Lift Authentication

我怕爱的太早我们不能终老 提交于 2019-12-08 05:55:24
问题 I want to create an authentication route for my Lift Application. Create a route, for instance www.myapp.com/user/login I am not using Lift forms/templating. The forms are rendered in JS. Send a post request with email and password. Call Lift authentication when that POST request is received. Use the Users.login(email, password) method to validate the credentials. Q: How do I tell Lift to authenticate the credentials incoming via /user/login ? 回答1: This is overly simplistic, but something

Scala and Lift and SessionVar that loses it contents

試著忘記壹切 提交于 2019-12-08 05:13:45
问题 I have SessionVar like this in Lift: object MyObject { object myVar extends SessionVar[Box[MyObject]](Empty) } Then I set value once for myVar: MyObject.myVar(Full(value)) My problem is that after some time (1-5 mins) myVar will lose its value, that is, it will have value Empty again. This is not due inactivity since I am clicking pages constantly. My code is not setting value to Empty. During this 1-5 mins the myVar will work correctly. The logs contain no related messages. I tried to add

Scala/Lift error on jetty:run - maven - eclipse

限于喜欢 提交于 2019-12-07 19:06:48
问题 I get this error when i run Maven with jetty:run, I wanna run a lift project on eclipse, it happened to me on macbook as well as on PC: Building FirstLiftweb Project 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> maven-jetty-plugin:6.1.22:run (default-cli) @ FirstLiftweb >>> [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] -----------------------------------------------

How to add a new page in Lift framework

佐手、 提交于 2019-12-07 16:48:15
问题 How can I add a new page in the webapp directory in lift that can be accessed by users? Currently only the index.html can be accessed through http://localhost:8080/ or http://localhost:8080/index.html Say I add a static file newpage.html into webapp dir, then what can I do so users can access it through http://localhost:8080/newpage.html ? 回答1: It's been a long time since I've done anything with Lift, but from what I remember, the easiest way may be to add the page in the menu entries in the

Background task in Liftweb environment

喜欢而已 提交于 2019-12-07 16:27:31
问题 I must write daemon and I want to use Models for connecting to the database and some useful Lift classes. Is it possible to run analog of Rails's rake tasks? 回答1: There is similar question on the Scala community group. The answer is to use Actors to do background processing. http://groups.google.com/group/liftweb/browse_thread/thread/ce536649e6e83867/ffde3a3d619adf9d?lnk=gst&q=background#ffde3a3d619adf9d 来源: https://stackoverflow.com/questions/3383076/background-task-in-liftweb-environment

Scala-Lift project in Eclipse Scala IDE errors

女生的网名这么多〃 提交于 2019-12-07 14:24:32
问题 I installed Scala IDE for Eclipse, and it seems to be working okay. So now I'm trying to import a Lift project (specifically -- autogenerated Lift project from Stax application platform), and now I'm having four errors at my workspace: value net is not a member of package <root> Boot.scala /rss2lj/src/scala/bootstrap/liftweb line [3..6] Scala Problem At lines: import _root_.net.liftweb.util._ import _root_.net.liftweb.http._ import _root_.net.liftweb.sitemap._ import _root_.net.liftweb

Setting / changing the default (“index”) page in a LiftWeb app

江枫思渺然 提交于 2019-12-07 12:00:32
I've googled like crazy but can't find an answer to this. How do I change the page displayed for http://www.mydomain.com/ ? (Right after the web app is created the page defaults to index.html . I'd like to change this!) You can't change it. Lift converts the request for "/" to List("index"). Any "blank" part of the request path is converted into "index". Thus, the "index.html" template will be used to serve "/index" and "/". 来源: https://stackoverflow.com/questions/6525039/setting-changing-the-default-index-page-in-a-liftweb-app

Lift RewriteResponse not finding a valid url

依然范特西╮ 提交于 2019-12-07 09:28:19
问题 Hi I'm having some trouble with Lift and URL rewriting. I've written a simple rewrite rule: LiftRules.rewrite.append { case RewriteRequest( ParsePath(List("user", userID), _, _, _), _, _) => { println(userID) RewriteResponse(List("viewUser"), Map("userID" -> urlDecode(userID))) } } So when I enter http://localhost:8080/user/brian I expect a call to be made to the viewUser.html file I have placed in the webroot directory. The mark up of viewUser.html is very simple: <lift:surround with=