Details

Professional Java for Web Applications


Professional Java for Web Applications


1. Aufl.

von: Nicholas S. Williams

46,99 €

Verlag: Wiley
Format: EPUB
Veröffentl.: 21.02.2014
ISBN/EAN: 9781118909317
Sprache: englisch
Anzahl Seiten: 944

DRM-geschütztes eBook, Sie benötigen z.B. Adobe Digital Editions und eine Adobe ID zum Lesen.

Beschreibungen

<p><b>The comprehensive Wrox guide for creating Java web applications for the enterprise</b></p> <p>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.</p> <ul> <li>Java is an essential programming language used worldwide for both Android app development and enterprise-level corporate solutions</li> <li>As a step-by-step guide or a general reference, this book provides an all-in-one Java development solution</li> <li>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</li> <li>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</li> <li>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</li> <li>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</li> <li>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</li> </ul> <p><i>Professional Java for Web Applications</i> 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.</p>
<p>Introduction xxiii</p> <p><b>Part I: Creating Enterprise Applications</b></p> <p><b>Chapter 1: Introducing Java Platform, Enterprise Edition 3</b></p> <p>A Timeline of Java Platforms 3</p> <p>Understanding the Basic Web Application Structure 13</p> <p>Summary 18</p> <p><b>Chapter 2: Using Web Containers 19</b></p> <p>Choosing a Web Container 19</p> <p>Installing Tomcat on Your Machine 23</p> <p>Deploying and Undeploying Applications in Tomcat 27</p> <p>Debugging Tomcat from Your IDE 30</p> <p>Summary 39</p> <p><b>Chapter 3: Writing Your First Servlet 41</b></p> <p>Creating a Servlet Class 42</p> <p>Configuring a Servlet for Deployment 46</p> <p>Understanding doGet(), doPost(), and Other Methods 51</p> <p>Using Parameters and Accepting Form Submissions 56</p> <p>Configuring your Application Using Init Parameters 61</p> <p>Uploading Files from a Form 64</p> <p>Making Your Application Safe for Multithreading 69</p> <p>Summary 71</p> <p><b>Chapter 4: Using JSPs to Di splay Content 73</b></p> <p><br /> is Easier Than output.println(“<br />”) 74</p> <p>Creating Your First JSP 78</p> <p>Using Java within a JSP (and Why You Shouldn’t!) 88</p> <p>Combining Servlets and JSPs 94</p> <p>A Note about JSP Documents (JSPX) 102</p> <p>Summary 104</p> <p><b>Chapter 5: Maintaining State Using Sessions 105</b></p> <p>Understanding Why Sessions are Necessary 106</p> <p>Using Session Cookies and URL Rewriting 107</p> <p>Storing Data in a Session 116</p> <p>Applying Sessions Usefully 129</p> <p>Clustering an Application That Uses Sessions 139</p> <p>Summary 142</p> <p><b>Chapter 6: U sing the Expression Language in JSPs 143</b></p> <p>Understanding Expression Language 144</p> <p>Writing with the EL Syntax 147</p> <p>Using Scoped Variables in EL Expressions 160</p> <p>Accessing Collections with the Stream API 167</p> <p>Replacing Java Code with Expression Language 172</p> <p>Summary 175</p> <p><b>Chapter 7: U sing the Java Standard Tag Library 177</b></p> <p>Introducing JSP Tags and the JSTL 178</p> <p>Using the Core Tag Library (C Namespace) 182</p> <p>Using the Internationalization and Formatting Tag Library (FMT Namespace) 193</p> <p>Using the Database Access Tag Library (SQL Namespace) 203</p> <p>Using the XML Processing Tag Library (X Namespace) 205</p> <p>Replacing Java Code with JSP Tags 205</p> <p>Summary 208</p> <p><b>Chapter 8: Writing Custom Tag and Function Libraries 209</b></p> <p>Understanding TLDs, Tag Files, and Tag Handlers 210</p> <p>Creating Your First Tag File to Serve as an HTML Template 219</p> <p>Creating a More Useful Date Formatting Tag Handler 221</p> <p>Creating an EL Function to Abbreviate Strings 226</p> <p>Replacing Java Code with Custom JSP Tags 227</p> <p>Summary 232</p> <p><b>Chapter 9: Improving Your Application Using Filters 233</b></p> <p>Understanding the Purpose of Filters 234</p> <p>Creating, Declaring, and Mapping Filters 235</p> <p>Ordering Your Filters Properly 239</p> <p>Investigating Practical Uses for Filters 247</p> <p>Simplifying Authentication with a Filter 254</p> <p>Summary 255</p> <p><b>Chapter 10: Making Your Application Interactive with WebSockets 257</b></p> <p>Evolution: From Ajax to WebSockets 258</p> <p>Understanding the WebSocket APIs 268</p> <p>Creating Multiplayer Games with WebSockets 273</p> <p>Using WebSockets to Communicate in a Cluster 284</p> <p>Adding “Chat with Support” to the Customer Support Application 288</p> <p>Summary 296</p> <p><b>Chapter 11: Using Logging to Monitor Your Application 297</b></p> <p>Understanding the Concepts of Logging 298</p> <p>Using Logging Levels and Categories 303</p> <p>Choosing a Logging Framework 305</p> <p>Integrating Logging into Your Application 312</p> <p>Summary 320</p> <p><b>Part II: Adding Spring Framework Into the Mix</b></p> <p><b>Chapter 12: Introducing Spring Framework 323</b></p> <p>What is Spring Framework? 324</p> <p>Why Spring Framework? 326</p> <p>Understanding Application Contexts 327</p> <p>Bootstrapping Spring Framework 329</p> <p>Configuring Spring Framework 336</p> <p>Utilizing Bean Definition Profiles 349</p> <p>Summary 353</p> <p><b>Chapter 13: Replacing Your Servlets with Controllers 355</b></p> <p>Understanding @RequestMapping 356</p> <p>Using Spring Framework’s Model and View Pattern 370</p> <p>Making Your Life Easier with Form Objects 380</p> <p>Updating the Customer Support Application 384</p> <p>Summary 387</p> <p><b>Chapter 14: Using Services and Repositories to Support Your Controllers 389</b></p> <p>Understanding Model-View-Controller Plus Controller-Service-Repository 390</p> <p>Using the Root Application Context Instead of a Web Application Context 394</p> <p>Improving Services with Asynchronous and Scheduled Execution 404</p> <p>Applying Logic Layer Separation to WebSockets 409</p> <p>Summary 416</p> <p><b>Chapter 15: Internationalizing Your Application with Spring Framework i18n 417</b></p> <p>Why Do You Need Spring Framework i18n? 418</p> <p>Using the Basic Internationalization and Localization APIs 419</p> <p>Configuring Internationalization in Spring Framework 424</p> <p>Internationalizing Your Code 430</p> <p>Summary 440</p> <p><b>Chapter 16: Using JSR 349, Spring Framework, and Hibernate Validator for Bean Validation 441</b></p> <p>What is Bean Validation? 442</p> <p>Configuring Validation in the Spring Framework Container 445</p> <p>Adding Constraint Validation Annotations to Your Beans 450</p> <p>Configuring Spring Beans for Method Validation 458</p> <p>Writing Your Own Validation Constraints 466</p> <p>Integrating Validation in the Customer Support Application 470</p> <p>Summary 472</p> <p><b>Chapter 17: Creating RESTful and SOAP Web Services 473</b></p> <p>Understanding Web Services 474</p> <p>Configuring RESTful Web Services with Spring MVC 484</p> <p>Testing Your Web Service Endpoints 496</p> <p>Using Spring Web Services for SOAP 500</p> <p>Summary 508</p> <p><b>Chapter 18: Using Messaging and Clustering for Flexibility and Reliability 509</b></p> <p>Recognizing When You Need Messaging and Clustering 510</p> <p>Adding Messaging Support to your Application 520</p> <p>Making your Messaging Distributable Across a Cluster 525</p> <p>Distributing Events with AMQP 534</p> <p>Summary 540</p> <p><b>Part III: Persisting Data with JPA and Hibernate ORM </b></p> <p><b>Chapter 19: Introducing Java Persistence API and Hibernate ORM 543</b></p> <p>What is Data Persistence? 543</p> <p>What is an Object-Relational Mapper? 547</p> <p>A Brief Look at Hibernate ORM 552</p> <p>Preparing a Relational Database 559</p> <p>A Note About Maven Dependencies 564</p> <p>Summary 564</p> <p><b>Chapter 20: Mapping Entities to Tables with JPA Annotations 565</b></p> <p>Getting Started with Simple Entities 566</p> <p>Creating and Using a Persistence Unit 581</p> <p>Mapping Complex Data Types 590</p> <p>Summary 596</p> <p><b>Chapter 21: Using JPA in Spring Framework Repositories 597</b></p> <p>Using Spring Repositories and Transactions 598</p> <p>Configuring Persistence in Spring Framework 602</p> <p>Creating and Using JPA Repositories 610</p> <p>Converting Data with DTOs and Entities 624</p> <p>Summary 632</p> <p><b>Chapter 22: Eliminating Boilerplate Repositories with Spring Data JPA 633</b></p> <p>Understanding Spring Data’s Unified Data Access 634</p> <p>Configuring and Creating Spring Data JPA Repositories 646</p> <p>Refactoring the Customer Support Application 656</p> <p>Summary 661</p> <p><b>Chapter 23: Searching for Data with JPA and Hibernate Search 663</b></p> <p>An Introduction to Searching 664</p> <p>Using Advanced Criteria to Locate Objects 666</p> <p>Taking Advantage of Full-Text Indexes with JPA 676</p> <p>Indexing Any Data with Apache Lucene and Hibernate Search 684</p> <p>Summary 692</p> <p><b>Chapter 24: Creating Advanced Mappings and Custom Data Types 693</b></p> <p>What’s Left? 694</p> <p>Converting Nonstandard Data Types 695</p> <p>Embedding POJOs Within Entities 699</p> <p>Defining Relationships Between Entities 703</p> <p>Addressing Other Common Situations 709</p> <p>Creating Programmatic Triggers 717</p> <p>Refining the Customer Support Application 720</p> <p>Summary 725</p> <p><b>Part IV: Securing Your Application with Spring Security</b></p> <p><b>Chapter 25: Introducing Spring Security 729</b></p> <p>What is Authentication? 729</p> <p>Why Spring Security? 743</p> <p>Summary 746</p> <p><b>Chapter 26: Authenticating Users with Spring Security 747</b></p> <p>Choosing and Configuring an Authentication Provider 748</p> <p>Writing Your Own Authentication Provider 766</p> <p>Summary 778</p> <p><b>Chapter 27: Using Authorization Tags and Annotations 779</b></p> <p>Authorizing by Declaration 780</p> <p>Understanding Authorization Decisions 794</p> <p>Creating Access Control Lists for Object Security 798</p> <p>Adding Authorization to Customer Support 804</p> <p>Summary 814</p> <p><b>Chapter 28: Securing RESTful Web Services with OAuth 815</b></p> <p>Understanding Web Service Security 816</p> <p>Introducing OAuth 818</p> <p>Using Spring Security OAuth 833</p> <p>Finishing the Customer Support Application 840</p> <p>Creating an OAuth Client Application 856</p> <p>Summary 862</p> <p>Index 865</p>
<p><b>Nicholas S. Williams</b> 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.</p>
<p><b>Take your Java coding skills to the next level</b></p> <p>There’s a reason that Java is one of the world's top programming languages. Programmers who are familiar with Java SE can easily move to building enterprise-level applications with Java EE that are secure, reliable, and scalable, without starting from square one. <i>Professional Java for Web Applications</i> is written with just this goal in mind. This book is for readers who already know Java SE, SQL, and basic HTML–established programmers who are ready to take their Java coding skills to the next level. Software developers can read this book from cover to cover or turn to individual sections for reference when specific Java programming questions arise.</p> <p><i>Professional Java for Web Applications:</i></p> <ul> <li>Offers self-guided, self-study insights into Java coding for enterprise-level web applications</li> <li>Helps web application architects apply new concepts to their development teams’ projects and processes</li> <li>Provides a comprehensive introduction to the Java EE platform version 7 and many of the technologies within it</li> <li>Explores Servlets, JSPs, WebSockets, Spring Framework, AMQP, JPA and O/RMs, Spring Data, full-text searching, Apache Lucene and Hibernate Search, Spring Security, and OAuth</li> <li>Features extensive use of lambda expressions and the new JSR 310 Java 8 Date and Time API, both additions to Java SE 8</li> </ul> <p><b>Wrox Professional guides</b> are planned and written by working programmers to meet the real-world needs of programmers, developers, and IT professionals. Focused and relevant, they address the issues technology professionals face every day. They provide examples, practical solutions, and expert education in new technologies, all designed to help programmers do a better job.</p>

Diese Produkte könnten Sie auch interessieren:

Domain Architectures
Domain Architectures
von: Daniel J. Duffy
PDF ebook
31,99 €