Learn Java for Web Development

(Tina Meador) #1

Servlets
context-InitParameters, 64
Expression Language, 109
accessing parameters/
headers/cookies, 109
bookstore application (see Bookstore
application)
deferred evaluation, 109
functions (see Functions)
immediate evaluation, 109
implicit objects (see Implicit objects)
literals, 110
object retrieval from scoped
attributes, 109
operators (see Operators)
reserved words, 110
filters, 65
authentication filters, 66
caching filters, 66
data compression filters, 67
declaration, 66
encryption filters, 67
group of servlets associated, 66
image conversion filters, 67
logging and auditing filters, 67
mapping, 66
first JSP, 108
first servlet, 107
getServletContext( ) method, 64
helloworld servlet
examining the request, 59
HTTP request mapped, 59
HTTP request message, 57
web server home page, 58
web.xml, 59
initialization parameters
getInitparam( ), 63
getServletConfig( ), 63
JSP, 107
JSP standard action and Expression
Language, 108
JSTL (see JSP Standard Tag Library (JSTL))
life-cycle methods, 60
destroy( ), 62
GenericServlet, 61
HttpServlet, 61
init( ), 61
service( ), 62


presentation(view) vs. business(servlet)
code, 107–108
RequestDispatcher
getRequestDispatcher( ) method, 65
sendRedirect( ), 64
ServletContext, 65
ServletRequest, 65
scriptlet, 108
ServletConfig, 63
ServletContext, 63
Servlet interface methods, 45
destroy( ), 46
getServletConfig( ), 46
get ServletInfo( ), 46
init, 46
life-cycle method, 46
service( ), 46
using annotations, configured
application accessed, 71
HelloWorld servlet, 67, 70
initialization parameters, 68
specifying methods, 69
URL mapping, 68
web application
adding server applications, 52
dynamic web project, 48
helloworld servlet, 49, 57
installed JRE, 47
Java class, 50
resource configured, 55
running helloworld application, 56
starting sever application, 56
Tomcat 7, 47
web module settings, 50
Web.xml Deployment Descriptor, 51
Simple Object Access Protocol (SOAP), 40
Single-line strings, 405
Single-page web application (SPA), 38
Singleton object, 432
Slashy strings, 407
Spread operator (*), 419
Spring framework
boilerplate code
BookDAO, 222
BookExtractor object, 224
BookMapper object, 224
BookRowMapper, 224
BookService, 222

444 Index

Free download pdf