lift

Why do people use _? as an identifier suffix?

最后都变了- 提交于 2019-12-23 07:27:53
问题 I start reading Lift framework source code, I find that there're so many methods are defined using a name like methodName_? , is there a convention that _? has some special meaning? def empty_? : Boolean = {} 回答1: The ? denotes that this is a predicate, a function returning Boolean . This convention goes back to Lisp, where ? (Scheme), p or -p (other Lisps, simulating the question mark with a "similar" letter) also denote predicates. Think of it as asking a question, "is the object empty?"

Lift store BigDecimal in MongoDB

纵然是瞬间 提交于 2019-12-23 05:14:39
问题 I am developing an ecommerce site in Lift with MongoDB I need to store some data for product prices My question is this: What field type should I use in MongoDB if I want to store data type BigDecimal In mapper is a field of type: MappedDecimal, but in net.liftweb.mongodb.record.field no equivalent How I can to store this information? Thank you all for your attention and help 回答1: As of MongoDB v2.6 there is no fixed-places decimal type. The data has to be saved in a field of a different type

Lift webapp has directory and resource with the same name, but gives 302

牧云@^-^@ 提交于 2019-12-23 04:43:09
问题 I deployed example.war to Tomcat 6.0.32 (latest at time of writing), and the deployed webapp contains the following: $ find example | egrep -v "WEB-INF/lib|WEB-INF/classes" example example/_items.html example/_share_link.html example/all_items.html example/images example/images/ajax-loader.gif example/index.html example/item example/item/star.html example/item.html example/js example/js/c-jquery-1.4.2.js example/js/c-jquery-ui-1.8.2.js example/js/jquery-1.4.2.js example/js/jquery-1.4.4.min.js

In which file do I need to add an override for the jetty port when running a lift webapp in dev mode from sbt?

时间秒杀一切 提交于 2019-12-23 02:38:43
问题 This page: http://www.assembla.com/wiki/show/liftweb/Using_SBT describes how to override the jetty port for lift webapps: override val jettyPort = 8081 but doesn't state the file that this override should be defined in. 回答1: In the project/build/ProjectNameProject.scala file: import sbt._ class ProjectNameProject(info: ProjectInfo) extends DefaultWebProject(info) { // other configuration override val jettyPort = 8081 } The jettyPort is defined in the DefaultProject.scala file of SBT. See here

Scala: remove field from json files in the nested object with defined name

北慕城南 提交于 2019-12-22 13:45:37
问题 I'm new to scala. I'm trying to make simple manipulations with json files. I'm stucked with the following task: how can I ellegant remove field with defined name within object with defined name. As an example I'd like to delete dsc1 field from the object name2 { "group": { "name1":{ "dsc":"some dsc", "dsc1":"some dsc", "dsc2":"some dsc" }, "name2":{ "dsc":"some dsc", "dsc1":"some dsc", "dsc2":"some dsc" } } } For parsing I'm using liftweb. I've cteate the following code but it deletes all

Scala: remove field from json files in the nested object with defined name

大兔子大兔子 提交于 2019-12-22 13:45:08
问题 I'm new to scala. I'm trying to make simple manipulations with json files. I'm stucked with the following task: how can I ellegant remove field with defined name within object with defined name. As an example I'd like to delete dsc1 field from the object name2 { "group": { "name1":{ "dsc":"some dsc", "dsc1":"some dsc", "dsc2":"some dsc" }, "name2":{ "dsc":"some dsc", "dsc1":"some dsc", "dsc2":"some dsc" } } } For parsing I'm using liftweb. I've cteate the following code but it deletes all

Get json data in d3 from lift snippet

北城余情 提交于 2019-12-22 11:34:13
问题 I am currently implementing a graph using d3 and a json object for data. A working example of such a graph can be found here: http://bl.ocks.org/950642. If you know d3 you can certainly directly jump to the My Problem part. Quick overview of code So, basically in my template I have the minimum code necessary: <div id="main" class="lift:surround?with=default;at=content"> <div class="lift:GraphVisual.showGraph"></div> </div> Then in my snippet ( GraphVisual.scala ) I have the following: def

Why am I getting OutOfMemoryError compilation error in Scala?

半世苍凉 提交于 2019-12-22 10:44:36
问题 I am working on a Lift project and trying to compile it with scala:cc and the scala compilation server using the jvm args: -Xmx1024m -Xss20m -XX:PermSize=64M -XX:MaxPermSize=512M -XX:+CMSClassUnloadingEnabled -XX:+CMSClassUnloadingEnabled The error also occurs with the jvm args: -Xmx1024m -Xss20m -XX:PermSize=64M -XX:MaxPermSize=512M The result is: [INFO] Compiling 16 source files to /Users/axaluss/IdeaProjects/trunk/Team_Skynet/target/classes at 1299141180948 [ERROR] java.lang

How to highlight parent of the current page?

牧云@^-^@ 提交于 2019-12-22 00:41:07
问题 How can I hightlight the parent menu item of the current page? I have a site map as follows: val siteMap = SiteMap( Menu("Home") / "index", Menu("Search") / "search" submenus ( Menu("Search Results") / "search-results") >> Hidden) and I use it as follows: <lift:Menu.builder ul:class="tabs" li_item:class="selected" /> However, when I navigate to the /search-results - the search menu item is no longer selected (i.e. the css class selected is no longer applied to it). Any tips? 回答1: it's quite

lift import net.liftweb returns an error “not found: value net”

霸气de小男生 提交于 2019-12-21 19:43:57
问题 I'm new with scala and lift but I already got the pocketchangeapp up and running and playing around with the RestAPI thing in it. Now I created a new project and it worked quite well until last night. I made my latest changes and commited them in svn but hat a problem with my workspace so I deleted my projects and did a checkout of the Project in svn. Since I did that my imports of net.liftweb._ (any classes also if I write the exact class name) only return an error in eclipse: import net