Learn Java for Web Development

(Tina Meador) #1

■ A


Action, Struts 2, 164
Action interface, 165
ActionSupport class, 166
Antipatterns, 158
Arithmetic operators, 110–111
Arrays, 386
Aspect-oriented programming (AOP), 217
Automating common functionalities, 158


■ B


Boilerplate code
BookDAO, 222
BookExtractor object, 224
BookMapper object, 224
BookRowMapper, 224
BookService, 222
configuration file, 225
data source, 226
JDBCtemplate, 221, 224
MVC module, 227
ResultSetExtractor interface, 225
stand-alone application, 226
BookService application, 8
Bookstore application, 19, 288
Author.java, 114–115
BookController.java, 115–116
Book.java, 114–115
controller creation
GGTS, 315
output, 315
simple textual response, 317
welcome screen, 316
creation
build path, 308
command line, 305
directory structure, 306, 312


existing Eclipse projects, 310–311
GGTS configuration, 307
new project, 309
data access layer 25, 33–34, 87
BookController, 196–197
directory structure, 195–196
display categories from database, 198
listing books by category, 199
login using database, 197
data model for
category table, 23
creating tables, 21
entity-relationship diagram, 20
many-to-many relationship,
book vs.author, 20–21
populated author table, 25
populated book table, 24
tables in database, 22
tables structure, 23
directory structure, 88, 117, 289
domain class
book domain class, 323
class generation, 323
constraints, 324
creation, 322–323
optional class name, 321
home page, 88–89
listing all books, 94
doPost( ) method, 95
findAllBooks( ) method, 96
login functionality
ApplicationResources.properties, 188
directory structure, 185
home.jsp, 188
LoginAction.java, 187–188
login failed, 184–185
login.jsp, 186
login screen, 183–184

Index


435
Free download pdf