CHF39.00
Download est disponible immédiatement
The comprehensive Wrox guide for creating Java web applications for the enterprise
This guide shows Java software developers and software engineers how to build complex web applications in an enterprise environment. You'll begin with an introduction to the Java Enterprise Edition and the basic web application, then set up a development application server environment, learn about the tools used in the development process, and explore numerous Java technologies and practices. The book covers industry-standard tools and technologies, specific technologies, and underlying programming concepts.
Java is an essential programming language used worldwide for both Android app development and enterprise-level corporate solutions
As a step-by-step guide or a general reference, this book provides an all-in-one Java development solution
Explains Java Enterprise Edition 7 and the basic web application, how to set up a development application server environment, which tools are needed during the development process, and how to apply various Java technologies
Covers new language features in Java 8, such as Lambda Expressions, and the new Java 8 Date & Time API introduced as part of JSR 310, replacing the legacy Date and Calendar APIs
Demonstrates the new, fully-duplex WebSocket web connection technology and its support in Java EE 7, allowing the reader to create rich, truly interactive web applications that can push updated data to the client automatically
Instructs the reader in the configuration and use of Log4j 2.0, Spring Framework 4 (including Spring Web MVC), Hibernate Validator, RabbitMQ, Hibernate ORM, Spring Data, Hibernate Search, and Spring Security
Covers application logging, JSR 340 Servlet API 3.1, JSR 245 JavaServer Pages (JSP) 2.3 (including custom tag libraries), JSR 341 Expression Language 3.0, JSR 356 WebSocket API 1.0, JSR 303/349 Bean Validation 1.1, JSR 317/338 Java Persistence API (JPA) 2.1, full-text searching with JPA, RESTful and SOAP web services, Advanced Message Queuing Protocol (AMQP), and OAuth
Professional Java for Web Applications is the complete Wrox guide for software developers who are familiar with Java and who are ready to build high-level enterprise Java web applications.
Auteur
Nicholas S. Williams is a recognized expert in Java and
related technologies. In 2010, he was named Software Engineer of
the Year for Middle Tennessee. Nick participates extensively in the
Open Source community, contributing bug fixes, new features, and
documentation to projects like Apache Log4J, Apache Tomcat, Jackson
Mapper, Spring Framework, and Spring Security.
Contenu
Introduction xxiii
Part I: Creating Enterprise Applications
Chapter 1: Introducing Java Platform, Enterprise Edition 3
A Timeline of Java Platforms 3
Understanding the Basic Web Application Structure 13
Summary 18
Chapter 2: Using Web Containers 19
Choosing a Web Container 19
Installing Tomcat on Your Machine 23
Deploying and Undeploying Applications in Tomcat 27
Debugging Tomcat from Your IDE 30
Summary 39
Chapter 3: Writing Your First Servlet 41
Creating a Servlet Class 42
Configuring a Servlet for Deployment 46
Understanding doGet(), doPost(), and Other Methods 51
Using Parameters and Accepting Form Submissions 56
Configuring your Application Using Init Parameters 61
Uploading Files from a Form 64
Making Your Application Safe for Multithreading 69
Summary 71
Chapter 4: Using JSPs to Di splay Content 73
is Easier Than output.println(
) 74
Creating Your First JSP 78
Using Java within a JSP (and Why You Shouldn't!) 88
Combining Servlets and JSPs 94
A Note about JSP Documents (JSPX) 102
Summary 104
Chapter 5: Maintaining State Using Sessions 105
Understanding Why Sessions are Necessary 106
Using Session Cookies and URL Rewriting 107
Storing Data in a Session 116
Applying Sessions Usefully 129
Clustering an Application That Uses Sessions 139
Summary 142
Chapter 6: U sing the Expression Language in JSPs 143
Understanding Expression Language 144
Writing with the EL Syntax 147
Using Scoped Variables in EL Expressions 160
Accessing Collections with the Stream API 167
Replacing Java Code with Expression Language 172
Summary 175
Chapter 7: U sing the Java Standard Tag Library 177
Introducing JSP Tags and the JSTL 178
Using the Core Tag Library (C Namespace) 182
Using the Internationalization and Formatting Tag Library (FMT Namespace) 193
Using the Database Access Tag Library (SQL Namespace) 203
Using the XML Processing Tag Library (X Namespace) 205
Replacing Java Code with JSP Tags 205
Summary 208
Chapter 8: Writing Custom Tag and Function Libraries 209
Understanding TLDs, Tag Files, and Tag Handlers 210
Creating Your First Tag File to Serve as an HTML Template 219
Creating a More Useful Date Formatting Tag Handler 221
Creating an EL Function to Abbreviate Strings 226
Replacing Java Code with Custom JSP Tags 227
Summary 232
Chapter 9: Improving Your Application Using Filters 233
Understanding the Purpose of Filters 234
Creating, Declaring, and Mapping Filters 235
Ordering Your Filters Properly 239
Investigating Practical Uses for Filters 247
Simplifying Authentication with a Filter 254
Summary 255
Chapter 10: Making Your Application Interactive with WebSockets 257
Evolution: From Ajax to WebSockets 258
Understanding the WebSocket APIs 268
Creating Multiplayer Games with WebSockets 273
Using WebSockets to Communicate in a Cluster 284
Adding Chat with Support to the Customer Support Application 288
Summary 296
Chapter 11: Using Logging to Monitor Your Application 297
Understanding the Concepts of Logging 298
Using Logging Levels and Categories 303
Choosing a Logging Framework 305
Integrating Logging into Your Application 312
Summary 320
Part II: Adding Spring Framework Into the Mix
Chapter 12: Introducing Spring Framework 323 What is Spring Fram...