-
Notifications
You must be signed in to change notification settings - Fork 16
/
chap-welcome.lyx
1770 lines (1361 loc) · 36.1 KB
/
chap-welcome.lyx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#LyX 1.6.7 created this file. For more info see http://www.lyx.org/
\lyxformat 345
\begin_document
\begin_header
\textclass book
\use_default_options false
\language english
\inputencoding auto
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\use_amsmath 1
\use_esint 1
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\author ""
\author ""
\end_header
\begin_body
\begin_layout Chapter
Welcome to Lift!
\begin_inset CommandInset label
LatexCommand label
name "cha:Welcome-to-Lift!"
\end_inset
\end_layout
\begin_layout Standard
Welcome to
\emph on
Exploring Lift
\emph default
.
We've created this book to educate you about Lift, which we think is a
great framework for building compelling web applications.
Lift is designed to make powerful techniques easily accessible while keeping
the overall framework simple and flexible.
It may sound like a clich
\family roman
\series medium
\shape up
\emph off
\bar no
\noun off
\color none
é
\family default
\series default
\shape default
\emph default
\bar default
\noun default
\color inherit
, but in our experience Lift makes it fun to develop because it lets you
focus on the interesting parts of coding.
Our goal for this book is that by the end, you'll be able to create and
extend any web application you can think of.
\end_layout
\begin_layout Section
Why Lift?
\end_layout
\begin_layout Standard
For those of you have experience with other web frameworks such as Struts,
Tapestry, Rails, et cetera, you must be asking yourself, "Why another framework
? Does Lift really solve problems any differently or more effectively than
the ones I've used before?" Based on our experience (and that of others
in the growing Lift community), the answer is an emphatic, "Yes!" Lift
has cherry-picked the best ideas from a number of other frameworks, while
creating some novel ideas of its own.
It's this combination of a solid foundation and new techniques that makes
Lift so powerful.
At the same time, Lift has been able to avoid the mistakes made in the
past by other frameworks.
In the spirit of
\begin_inset Quotes eld
\end_inset
convention over configuration,
\begin_inset Quotes erd
\end_inset
Lift has sensible defaults for everything while making it easy to customize
precisely what you need to: no more and no less.
Gone are the days of XML file after XML file providing
\emph on
basic configuration
\emph default
for your application.
Instead, a simple Lift app requires only that you add the LiftFilter to
your web.xml and add one or more lines telling Lift what package your classes
sit in (Section
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:Bootstrap"
\end_inset
).
The methods you code aren't required to implement a specific interface
(called a trait), although there are support traits that make things that
much simpler.
In short, you don't need to write anything that isn't explicitly necessary
for the task at hand.
Lift is intended to work out of the box, and to make you as efficient and
productive as possible.
\end_layout
\begin_layout Standard
One of the key strengths of Lift is the clean separation of presentation
content and logic, based on the bedrock concept of the Model-View-Controller
\begin_inset Index
status collapsed
\begin_layout Plain Layout
MVC
\end_layout
\end_inset
pattern
\begin_inset Foot
status open
\begin_layout Plain Layout
\begin_inset Flex URL
status open
\begin_layout Plain Layout
http://java.sun.com/blueprints/patterns/MVC.html
\end_layout
\end_inset
\end_layout
\end_inset
.
One of the original Java web application technologies that's still in use
today is JSP, or Java Server Pages
\begin_inset Foot
status open
\begin_layout Plain Layout
\begin_inset Flex URL
status open
\begin_layout Plain Layout
http://java.sun.com/products/jsp/
\end_layout
\end_inset
\end_layout
\end_inset
.
JSP allows you to mix HTML and Java code directly within the page.
While this may have seemed like a good idea at the start, it has proven
to be painful in practice.
Putting code in your presentation layer makes it more difficult to debug
and understand what is going on within a page, and makes it more difficult
for the people writing the HTML portion because the contents aren't valid
HTML.
While many modern programming and HTML editors have been modified to accomodate
this mess, proper syntax highlighting and validation don't make up for
having to switch back and forth between one or more files to follow the
page flow.
Lift takes the approach that there should be no code in the presentation
layer, but that the presentation layer has to be flexible enough to accomodate
any conceivable use.
To that end, Lift uses a powerful templating system, à la Wicket
\begin_inset Foot
status open
\begin_layout Plain Layout
\begin_inset Flex URL
status open
\begin_layout Plain Layout
http://wicket.apache.org/
\end_layout
\end_inset
\end_layout
\end_inset
, to bind user-generated data into the presentation layer.
Lift's templating is built on the XML processing capabilities of the Scala
language
\begin_inset Foot
status open
\begin_layout Plain Layout
Not only does Scala have extensive library support for XML, but XML syntax
is actually part of the language.
We'll cover this in more detail as we go through the book.
\end_layout
\end_inset
, and allows such things as nested templates, simple injection of user-generated
content, and advanced data binding capabilities.
For those coming from JSP, Lift's advanced template and XML processing
allows you essentially to write custom tag libraries at a fraction of the
cost in time and effort.
\end_layout
\begin_layout Standard
Lift has another advantage over many other web frameworks: it's designed
specifically to leverage the Scala
\begin_inset Index
status collapsed
\begin_layout Plain Layout
Scala
\end_layout
\end_inset
programming language.
Scala is a relatively new language developed by Martin Odersky
\begin_inset Foot
status open
\begin_layout Plain Layout
Martin created the Pizza programming language, which led to the Generic
Java (GJ) project that was eventually incorporated into Java 1.5.
His home page is at
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
http://lamp.epfl.ch/~odersky/
\end_layout
\end_inset
\end_layout
\end_inset
and his programming language research group at EPFL Switzerland.
It compiles to Java bytecode and runs on the JVM, which means that you
can leverage the vast ecosystem of Java libraries just as you would with
any other Java web framework.
At the same time, Scala introduces some very powerful features designed
to make you, the developer, more productive.
Among these features are an extremely rich type system along with powerful
type inference, native XML processing, full support for closures and functions
as objects, and an extensive high-level library.
The power of the type system together with type inference has led people
to call it
\begin_inset Quotes eld
\end_inset
the statically-typed dynamic language
\begin_inset Quotes erd
\end_inset
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
http://scala-blogs.org/2007/12/scala-statically-typed-dynamic-language.html
\end_layout
\end_inset
\end_layout
\end_inset
.
That means you can write code as quickly as you can with dynamically-typed
languages (e.g.
Python, Ruby, etc.), but you have the compile-time type safety of a statically-t
yped language such as Java.
Scala is also a hybrid functional (FP) and object-oriented (OO) language,
which means that you can get the power of higher-level functional languages
such as Haskell or Scheme while retaining the modularity and reusability
of OO components.
In particular, the FP concept of immutability is encouraged by Scala, making
it well-suited for writing highly-concurrent programs that achieve high
throughput scalability.
The hybrid model also means that if you haven't touched FP before, you
can gradually ease into it.
In our experience, Scala allows you to do more in Lift with fewer lines
of code.
Remember, Lift is all about making you more productive!
\end_layout
\begin_layout Standard
Lift strives to encompass advanced features in a very concise and straightforwar
d manner.
Lift's powerful support for AJAX and Comet allows you to use Web 2.0 features
with very little effort.
Lift leverages Scala's Actor library to provide a message-driven framework
for Comet updates.
In most cases, adding Comet support to a page involves nothing more than
extending a trait
\begin_inset Foot
status open
\begin_layout Plain Layout
A trait is a Scala construct that's almost like a Java interface.
The main difference is that traits may implement methods and have fields.
\end_layout
\end_inset
to define the rendering method of your page and adding an extra function
call to your links to dispatch the update message.
Lift handles all of the back-end and page-side coding to provide the Comet
polling.
AJAX support includes special handlers for doing AJAX form submission via
JSON, and almost any link function can easily be turned into an AJAX version
with a few keystrokes.
In order to perform all of this client-side goodness, Lift has a class
hierarchy for encapsulating JavaScript calls via direct JavaScript, jQuery,
and YUI.
The nice part is that you, too, can utilize these support classes so that
code can be generated for you and you don't have to put JavaScript logic
into your templates.
\end_layout
\begin_layout Section
What You Should Know before Starting
\end_layout
\begin_layout Standard
First and foremost, this is a book on the Lift framework.
There are several things we expect you to be familiar with before continuing:
\end_layout
\begin_layout Itemize
The Scala language and standard library.
This book is not intended to be an introduction to Scala: there are several
very good books available that fill that role.
You can find a list of Scala books at the Scala website,
\begin_inset CommandInset href
LatexCommand href
target "http://www.scala-lang.org/node/959"
\end_inset
.
\end_layout
\begin_layout Itemize
HTML and XML.
Lift relies heavily on XHTML for its template support, so you should understand
such things as DocTypes, elements, attributes, and namespaces.
\end_layout
\begin_layout Itemize
General HTTP processing, including GET and POST submission, response codes,
and content types.
\end_layout
\begin_layout Section
Typographical Conventions
\end_layout
\begin_layout Standard
In order to better communicate concepts and techniques in this book, we
have adopted the following typographical conventions:
\end_layout
\begin_layout List
\labelwidthstring 00.00.0000
\family typewriter
ClassName
\family default
Monospaced typewriter text is used to indicate types, class names, and
other code-related information.
\end_layout
\begin_layout List
\labelwidthstring 00.00.0000
...
Ellipses within code listings are used to indicate omission of code to
condense listings.
Unless otherwise noted, the example code in this book comes from the PocketChan
ge app (Chapter
\begin_inset CommandInset ref
LatexCommand vref
reference "cha:PocketChange"
\end_inset
), which has full source code available on GitHub.
\end_layout
\begin_layout Section
For More Information about Lift
\begin_inset CommandInset label
LatexCommand label
name "sec:For-more-information"
\end_inset
\end_layout
\begin_layout Standard
Lift has a very active community of users and developers.
Since its inception in early 2007 the community has grown to hundreds of
members from all over the world.
The project's leader, David Pollak
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
http://blog.lostlake.org/
\end_layout
\end_inset
\end_layout
\end_inset
, is constantly attending to the mailing list, answering questions, and
taking feature requests.
There is a core group of developers who work on the project, but submissions
are taken from anyone who makes a good case and can turn in good code.
While we strive to cover everything you'll need to know in this book, there
are several additional resources available for information on Lift:
\end_layout
\begin_layout Enumerate
The first place to look is the Lift website at
\begin_inset Flex URL
status open
\begin_layout Plain Layout
http://liftweb.net/
\end_layout
\end_inset
.
There are links to lots of information on the site.
In particular:
\end_layout
\begin_deeper
\begin_layout Enumerate
The Lift Wiki is hosted at
\begin_inset Flex URL
status open
\begin_layout Plain Layout
http://www.assembla.com/wiki/show/liftweb
\end_layout
\end_inset
.
The Wiki is maintained not only by David, but also by many active members
of the Lift community, including the authors.
Portions of this book are inspired by and borrow from content on the Wiki.
In particular, it has links to all of the generated documentation not only
for the stable branch, but also for the unstable head, if you're feeling
adventurous.
There's also an extensive section of HowTos and articles on advanced topics
that cover a wealth of information.
\end_layout
\begin_layout Enumerate
The mailing list at
\begin_inset Flex URL
status open
\begin_layout Plain Layout
http://groups.google.com/group/liftweb
\end_layout
\end_inset
is very active, and if there are things that this book doesn't cover, you
should feel free to ask questions there.
There are plenty of very knowledgeable people on the list that should be
able to answer your questions.
Please post specific questions about the book to the Lift Book Google Group
at
\begin_inset Flex URL
status open
\begin_layout Plain Layout
http://groups.google.com/group/the-lift-book
\end_layout
\end_inset
.
Anything else that is Lift-specific is fair game for the mailing list.
\end_layout
\end_deeper
\begin_layout Enumerate
Tim Perrett, another Lift committer, is writing a book on Lift for Manning
called
\emph on
Lift in Action
\emph default
.
More details can be found at the book's site at
\begin_inset Flex URL
status open
\begin_layout Plain Layout
http://www.manning.com/perrett/
\end_layout
\end_inset
.
\end_layout
\begin_layout Enumerate
Lift has an IRC channel at
\begin_inset Flex URL
status open
\begin_layout Plain Layout
irc://irc.freenode.net/lift
\end_layout
\end_inset
that usually has several people on it at any given time.
It's a great place to chat about issues and ideas concerning Lift.
\end_layout
\begin_layout Section
Your First Lift Application
\end_layout
\begin_layout Standard
We've talked a lot about Lift and its capabilities, so now let's get hands-on
and try out an application.
Before we start, though, we need to take care of some prerequisites:
\end_layout
\begin_layout Description
Java
\begin_inset space ~
\end_inset
1.5
\begin_inset space ~
\end_inset
JDK Lift runs on Scala, which runs on top of the JVM.
The first thing you'll need to install is a modern version of the Java
SE JVM, available at
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
http://java.sun.com/
\end_layout
\end_inset
.
Recently Scala's compiler was changed to target Java version 1.5.
Version 1.4 is still available as a target, but we're going to assume you're
using 1.5.
Examples in this book have only been tested with Sun's version of the JDK,
although most likely other versions (e.g.
Blackdown or OpenJDK) should work with little or no modification.
\end_layout
\begin_layout Description
Maven
\begin_inset space ~
\end_inset
2 Maven
\begin_inset Index
status collapsed
\begin_layout Plain Layout
Maven
\end_layout
\end_inset
is a project management tool that has extensive capabilities for building,
dependency management, testing, and reporting.
We assume that you are familiar with basic Maven usage for compilation,
packaging, and testing.
If you haven't used Maven before, you can get a brief overview in appendix
\begin_inset CommandInset ref
LatexCommand ref
reference "cha:Maven"
\end_inset
.
You can download the latest version of Maven from
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
http://maven.apache.org/
\end_layout
\end_inset
.
Brief installation instructions (enough to get us started) are on the download
page, at
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
http://maven.apache.org/download.html
\end_layout
\end_inset
.
\end_layout
\begin_layout Description
A
\begin_inset space ~
\end_inset
programming
\begin_inset space ~
\end_inset
editor This isn't a strict requirement for this example, but when we start
getting into coding, it's very helpful to have something a little more
capable than Notepad.
If you'd like a full-blown IDE with support for such things as debugging,
continuous compile checking, etc., then there are plugins available on the
Scala website at
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
http://www.scala-lang.org/node/91
\end_layout
\end_inset
.
The plugins support:
\end_layout
\begin_deeper
\begin_layout List
\labelwidthstring 00.00.0000
Eclipse
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
http://www.eclipse.org/
\end_layout
\end_inset
The Scala Plugin developer recommends using the Eclipse Classic version
of the IDE
\end_layout
\begin_layout List
\labelwidthstring 00.00.0000
NetBeans
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
http://www.netbeans.org
\end_layout
\end_inset
Requires using NetBeans 6.5
\end_layout
\begin_layout List
\labelwidthstring 00.00.0000
IntelliJ IDEA
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
http://www.jetbrains.com/idea/index.html
\end_layout
\end_inset
Requires Version 8 Beta
\end_layout
\begin_layout Standard
If you'd like something more lightweight, the Scala language distribution
comes with plugins for editors such as Vim, Emacs, jEdit, etc.
You can either download the full Scala distribution from
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
http://www.scala-lang.org/
\end_layout
\end_inset
and use the files under
\family typewriter
misc/scala-tool-support
\family default
, or you can access the latest versions directly via the SVN (Subversion)
interface at
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
https://lampsvn.epfl.ch/trac/scala/browser/scala-tool-support/trunk/src
\end_layout
\end_inset
.
Getting these plugins to work in your IDE or editor of choice is beyond
the scope of this book.
\end_layout
\end_deeper
\begin_layout Standard
Now that we have the prerequisites out of the way, it's time to get started.
We're going to leverage Maven's archetypes
\begin_inset Foot
status open
\begin_layout Plain Layout
An archetype is essentially a project template for Maven that provides prompt-dr
iven customization of basic attributes.
\end_layout
\end_inset
to do 99% of the work for us in this example.
First, change to whatever directory you'd like to work in:
\end_layout
\begin_layout LyX-Code
cd work
\end_layout
\begin_layout Standard
Next, we use Maven's
\family typewriter
archetype:generate
\family default
command to create the skeleton of our project:
\end_layout
\begin_layout LyX-Code
mvn archetype:generate -U
\backslash
\end_layout
\begin_layout LyX-Code
-DarchetypeGroupId=net.liftweb
\backslash
\end_layout
\begin_layout LyX-Code
-DarchetypeArtifactId=lift-archetype-blank
\backslash
\end_layout
\begin_layout LyX-Code
-DarchetypeVersion=2.0
\backslash
\end_layout
\begin_layout LyX-Code
-DarchetypeRepository=http://scala-tools.org/repo-releases
\backslash
\end_layout
\begin_layout LyX-Code
-DgroupId=demo.helloworld
\backslash
\end_layout
\begin_layout LyX-Code
-DartifactId=helloworld
\backslash
\end_layout
\begin_layout LyX-Code
-Dversion=1.0-SNAPSHOT
\end_layout
\begin_layout Standard
Maven should output several pages of text.
It may stop and ask you to confirm the properties configuration, in which
case you can just hit
\family typewriter
<enter>
\family default
.
At the end you should get a message that says
\family typewriter
BUILD SUCCESSFUL
\family default
.
You've now successfully created your first project! Don't believe us? Let's
run it to confirm:
\end_layout
\begin_layout LyX-Code
cd helloworld
\end_layout
\begin_layout LyX-Code
mvn jetty:run
\end_layout
\begin_layout Standard
Maven should produce more output, ending with
\end_layout
\begin_layout LyX-Code
[INFO] Starting scanner at interval of 5 seconds.
\end_layout
\begin_layout Standard
This means that you now have a web server (Jetty
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
http://www.mortbay.org/jetty/
\end_layout
\end_inset
\end_layout
\end_inset
) running on port 8080 of your machine.
Just go to
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
http://localhost:8080/
\end_layout
\end_inset
and you'll see your first Lift page, the standard
\begin_inset Quotes eld
\end_inset
Hello, world!
\begin_inset Quotes erd
\end_inset
With just a few simple commands, we've built a functional (albeit limited)
web app.
Let's go into a little more detail and see exactly how these pieces fit
together.
First, let's examine the index page.
Whenever Lift serves up a request in which the URL ends with a forward
slash, Lift automatically looks for a file called
\family typewriter
index.html
\family default
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
Technically, it also searches for some variations on index.html, including
any localized versions of the page, but we'll cover that later in section
\begin_inset Note Note
status open
\begin_layout Plain Layout
TODO: Need a cross reference here
\end_layout
\end_inset
\end_layout
\end_inset
in that directory.
For instance, if you tried to go to
\family typewriter
http://localhost:8080/test/
\family default
, Lift would look for
\family typewriter
index.html
\family default
under the