ebook img

Java EE Development with Eclipse - Second Edition PDF

583 Pages·2015·18.11 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Java EE Development with Eclipse - Second Edition

Table of Contents Java EE Development with Eclipse Second Edition Credits About the Author About the Reviewers www.PacktPub.com Support files, eBooks, discount offers, and more Why subscribe? Free access for Packt account holders Preface What this book covers What you need for this book Who this book is for Conventions Reader feedback Customer support Downloading the example code Errata Piracy Questions 1. Introducing JEE and Eclipse Java Enterprise Edition (JEE) The presentation layer Java Servlet Java Server Pages Java Server Faces The business layer Enterprise Java Beans The enterprise integration layer Java Database Connectivity (JDBC) The Java Persistent API (JPA) Java Connector Architecture (JCA) Web services Eclipse IDE Workspace Plugin Editors and views Perspective Eclipse preferences Installing products Installing Eclipse (Version 4.4) Installing Tomcat Installing the GlassFish server Installing MySQL Installing MySQL on Windows Installing MySQL on Mac OS X Installing MySQL on Linux Creating MySQL users Summary 2. Creating a Simple JEE Web Application Configuring Tomcat in Eclipse Java Server Pages Creating a dynamic web project Creating JSP Running JSP in Tomcat Using JavaBeans in JSP Using JSTL Implementing login application using Java Servlet Creating WAR Java Server Faces Using Maven for project management Maven views and preferences in Eclipse JEE Creating a Maven project Maven Archetype Exploring the POM Adding Maven dependencies The Maven project structure Creating WAR using Maven Summary 3. Source Control Management in Eclipse The Eclipse Subversion plugin Installing the Eclipse Subversion plugin Adding a project to an SVN repository Committing changes to an SVN repository Synchronizing with an SVN repository Checking out a project from SVN The Eclipse Git plugin Adding a project to Git Committing files in a Git repository Viewing a file difference after modifications Creating a new branch Committing a project to a remote repository Pulling changes from a remote repository Cloning a remote repository Summary 4. Creating a JEE Database Application Creating a database schema The script for creating tables and relationships Creating tables in MySQL Creating a database application using JDBC Creating a project and setting up Maven dependencies Creating JavaBeans for data storage Creating JSP to add a course JDBC concepts Creating a database connection Executing SQL statements Handling transactions Using the JDBC database connection pool Saving a course in a database table using JDBC Getting courses from the database table using JDBC Completing the add Course functionality Using Eclipse Data Source Explorer Creating a database application using JPA Creating the user interface for adding a course using JSF JPA concepts Entity EntityManager EntityManagerFactory Creating a JPA application Creating a new MySQL schema Setting up a Maven dependency for JPA Converting a project into a JPA project Creating entities Configuring entity relationships Configuring a many-to-one relationship Configuring a many-to-many relationship Creating database tables from entities Using JPA APIs to manage data Wiring the user interface with a JPA service class Summary 5. Unit Testing JUnit Creating and executing unit tests using Eclipse EE Creating a unit test case Running a unit test case Running a unit test case using Maven Mocking external dependencies for unit tests Using Mockito Calculating test coverage Summary 6. Debugging a JEE Application Debugging a remote Java application Debugging a web application using Tomcat in Eclipse EE Starting Tomcat in debug mode Setting breakpoints Running an application in debug mode Performing step operations and inspecting variables Inspecting variable values Debugging an application in an externally configured Tomcat Using Debugger to know the status of a program execution Summary 7. Creating JEE Applications with EJB Types of EJB Session bean Stateful session bean Stateless session bean Singleton session bean Accessing session bean from the client Creating a no-interface session Accessing session bean using dependency injection Creating session bean using the local business interface Accessing session bean using the JNDI lookup Creating session bean using a remote business interface Accessing a remote session bean Configuring the GlassFish server in Eclipse Creating the CourseManagement application using EJB Creating an EJB project in Eclipse Configuring datasource in GlassFish 4 Configuring JPA Creating a JPA entity Creating stateless EJB Creating JSF and managed bean Running the example Creating EAR for deployment outside Eclipse Creating a JEE project using Maven Summary 8. Creating Web Applications with Spring MVC Dependency injection Dependency injection in Spring Component scopes Installing the Spring Tool Suite Creating a Spring MVC application Creating a Spring project Understanding files created by the Spring MVC project template Spring MVC application using JDBC Configuring datasource Using the Spring JDBCTemplate class Creating the Spring MVC Controller Calling Spring MVC Controller Mapping data using @ModelAttribute Using parameters in @RequestMapping Using the Spring interceptor Spring MVC application using JPA Configuring JPA Creating the Course entity Creating Course DAO and Controller Creating the Course list view Summary 9. Creating Web Services JAXB JAXB example REST web services Creating RESTful web services using Jersey Implementing the REST GET request Testing the REST GET request in browser Creating a Java client for the REST GET web service Implementing the REST POST request Writing a Java client for the REST POST web service Invoking the POST REST web service from JavaScript Creating the REST web service with Form POST Creating a Java client for the form-encoded REST web service SOAP web services SOAP WSDL UDDI Developing web services in Java Creating a web service implementation class Using the JAX-WS reference implementation (GlassFish Metro) Inspecting WSDL Implementing a web service using an interface Consuming a web service using JAX-WS Specifying an argument name in a web service operation Inspecting SOAP messages Handling interfaces in an RPC-style web service Handling exceptions Summary 10. Asynchronous Programming with JMS Steps to send and receive messages using JMS Creating queues and topics in GlassFish Creating a JEE project for a JMS application Creating a JMS application using JSP and JSP bean Executing addCourse.jsp Implementing a JMS queue sender class Implementing a JMS queue receiver class Adding multiple queue listeners Implementing the JMS topic publisher Implementing the JMS topic subscriber Creating a JMS application using JSF and managed beans Consuming JMS messages using MDB Summary 11. Java CPU Profiling and Memory Tracking Creating a sample Java project for profiling Profiling a Java application Identifying resource contention Memory tracking Eclipse plugins for profiling memory Summary Index Java EE Development with Eclipse Second Edition Java EE Development with Eclipse Second Edition Copyright © 2015 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: December 2012 Second edition: September 2015 Production reference: 1240915 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78528-534-9

Description:
Develop, debug, test, and troubleshoot Java EE 7 applications rapidly with EclipseAbout This BookGo beyond simply learning Java EE APIs and explore the complete workflow of developing enterprise Java applicationsLearn to use the features of Eclipse JEE to simplify Java EE application developmentDeve
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.