struts 2-core dependency, 186
struts.xml, 187
successful login, 184
welcome file, 186
MVC architecture, 89
accessing jsp model, 93
deployment descriptor, 90
doget( ) method, 92
doPost( ) method, 92
findAllCategories( ), 91
init( ) method, 91
RequestDispatcher, 93
relationship between book and
author, 114–115
running application
command history, 314
welcome screen, 313
search books by category, 96
doPost( ) method, 97
findAllBooks( ) method, 98
searchBooksByKeyword( ) method, 98, 103
accessing CSS and jQuery files, 101
CSS tooltip, 100
doPost( ) method, 102
jQuery image tooltip, 100
jQuery tooltip, 99
searchBooks( ) method, 102
search field markup, 99, 101
Spring framework
faces-config.xml, 291
web.xml file, 290
Spring JDBCTemplate, 288, 291
applicationContext.xml, 293
BookController, 292
stand-alone Java application, 87
template development
base layout, 193–194
directory structure, 191
failed login with header, 190
header and menu, 188–189
header.jsp, 194
login screen with header, 189
slf4j-log4j12 plug-in, 191
struts-tiles plug-in, 191
struts.xml, 192
successful login with menu, 190–191
tiles, 188
tiles.xml, 192–193
web.xml, 195
templates, 293
testing
BookControllerTests, 317
command test-app, 318
failed test, 321
incorrect assertion, 319
passed test, 319
test-app command, 318
testSomething( ), 318
UI components and JSF EL, 294
bookList.html, 296
home.xhtml, 296
web.xml, 116–117
■ C
Classes
Java, 383
Scala, 429
Clojure, 2
Closures
explicit declaration, 418
free variables, 417
higher-order functions, 415
implicit variables, 417
passing, 419
referential transparency, 415
return keyword, 417
reusing, 418
with parameter, 416
Code scattering, 8
Code tangling, 8
Composite view pattern
class diagram, 152
parent and embedded subviews, 152
usage of, 152–153
Conditionals
functional area, 135
<c:choose> action, 136–137
<c:if> action, 135–136
<c:otherwise> action, 137
Configurability, 158
Constructor chaining, 391
Constructors, 387
436 Index
Bookstore application (cont.)