Just wanted to say that I have never seen a community like this. Its fantastic!
On Wed, Oct 21, 2009 at 11:05 PM, David Pollak < [email protected]> wrote: > > > On Wed, Oct 21, 2009 at 4:15 PM, Strom <[email protected]> wrote: > >> >> Hello everyone, >> I am pretty much brand new to lift and scala, and I come from a non- >> framework jsp/java servlet/hibernate background. I've been reading >> this board, Beginning Scala, The lift book, and googling how to use >> the lift framework, but I can't seem to find some basic info. > > > That's why we're here. Ask away! > > >> Please >> help me out. I know these are very basic questions, and posting on the >> group was a last resort after coming up empty on searches. I want to >> start off with best practices since I'm beginning from scratch. >> > > Doing some searching is great, but asking on list is heartily encouraged. > > >> >> 1. Directory structure - where is everything? >> Looking at the PocketChange example and making a basic lift 1.0 >> project via netbeans, I know that the DB schema go under "model", the >> snippets in "snippet", the templates in the corresponding "webapp/ >> templates-hidden" directory, and the web pages in the "webapp" >> directory. >> >> What I don't know is where /classpath or <lift:CSS.blueprint> are >> actually going. Is classpath still going to "src/main/resources/ >> toserve", or is that old info? Looking at the default.html template, >> there's no jquery.js or CSS files in a "toserve" directory; in fact >> there is no "toserve" directory period, so I made my own. Also I see >> "<lift:CSS.blueprint>", and I have no idea where that's going. I don't >> see any CSS class with blueprint method, but the syntax looks clean >> and I'd like to add my own custom stylesheet in the same fashion. >> > > The /classpath stuff is served out of the Lift JAR file rather than out of > a directory. If you want to have your own CSS, just put it in > /src/webapp/css/xxx.css and then refer to /css/xxx.css in your web page. > > >> >> 2. Dynamically generated HTML - what's the best practice, and how to >> do it? >> > > Snippets are the way that Lift does dynamic HTML. It's not a templating > system, but a binding between your XHTML file and methods on classes that > substitute the dynamically generated HTML. > > >> I would like to know what the lift equivalent is for the following: >> >> <a href="<%=request.getContextPath()%>/home/index.jsp">Index</a> >> > > In the case of Lift, you don't have to do this. <a > href="/home/index">index</a> will automatically be rewritten for the correct > context path. No work on your part. > >> >> That's the way I was taught to link web pages together because it >> avoids hardcoding the page location, but the main point is the stuff >> inside <%=...%>. It looks like the lift uses {...}, but this example >> from the lift book causes an IllegalArgumentException (bad XML >> according to the msgs I've found on this board): >> <link type="text/css" rel="stylesheet" href= >> {LiftRules.resourceServerPath + "/css/style.css" } /> >> > > If you're writing Scala, then you can do substitutions like the one above, > but Lift's views are not like JSP templates. In the above case, you can > simply say: > <link type="text/css" rel="stylesheet" href="/css/style.css"/> > > And it will be automatically updated based on the context path. > >> >> How do I go about making this work, and in what scenarios should I be >> using this {...} approach vs snippets? >> >> Note: An earlier example in the lift book used href="/classpath/css/ >> style.css", but later on said that the 1st method is better. The basic >> lift archetype references /classpath everywhere as well, so I don't >> know what to believe. >> >> I guess those are the glaring questions I have right now. In addition, >> what are some common search terms I could use to find this sort of >> basic info on the board, or where can I find best practices info and >> more examples of working sites? I'd rather see what documentation/ >> tutorials already exists for beginners before I send more messages for >> the board, but my main issue is knowing whether or not I'm getting the >> right information; most every lift example document/wiki/tutorial I've >> seen is outdated code or incomplete. I'm looking for more code >> examples that comply with lift's current evolution. The lift book is >> helpful, but I also feel a little left out when I read it because I >> get the feeling the book assumes the reader knows certain lift and >> scala basics that are obvious to more seasoned users, but not to...me. >> >> Thank you so much for your help! >> >> > Sure thing. > > Welcome to the community. > > Thanks, > > David > >> >> > > > -- > Lift, the simply functional web framework http://liftweb.net > Beginning Scala http://www.apress.com/book/view/1430219890 > Follow me: http://twitter.com/dpp > Surf the harmonics > > > > > -- Jack --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
