J2EE, SPRING & HIBERNATE – COURSE CONTENTS@ 12 Days Day Day - 01
Topics JEE Application Architectures • JEE and the Web • JEE 1st Generation DB-centric Web Application • Adding JSPs to Separate Presentation • Eliminating Java code from view • The Model 2 Architecture • Using EJBs • N-Tier Architecture • JEE Infrastructure Supporting Web Applications Lesson Review Understanding Web Applications • JEE Application Modules • The Truth about Archives • Enterprise Application Archive (EAR) • Enterprise JavaBean Archive (JAR) • JEE Application Client (JAR) • Resource Adapter Archive (RAR) • Web Application Archive (WAR) • Directory Structure Introduction to Webservers - Tomcat - Tomcat basics - Server configurations - Deployments - Monitoring Developing Servlets Introduction to Servlets • Servlet Overview • Life Cycle of Servlets • Servlet Lifecycle is Handled by Web Container • GenericServlet & HttpServlet • Writing the init Method • HttpServlet doXXX Methods • Writing a Simple Servlet • ServletRequest • HttpServletRequest Methods • ServletResponse • HttpServletResponse • Servlet I/O Classes Configuring Web Applications • Mapping an HTTP Request to a Resource • The web.xml File • Structure
o o o o o o o
Declaring Servlets and JSPs Servlet Mapping Servlet Init Parameters Web Application init Parameters Welcome Page Error Page Session Tracking in servlets
•
Annotations and Web Applications o Use in Java classes o Use for resource access o Features not handled • Internationalization using Servlets • Threadsafe Servlets • FilterServlets • Deploying a web application in different web servers
Day - 02
Session
Developing JavaServer Pages
Lesson Introduction to JavaServer Pages • Separating Presentation from Model • Java Server Page (JSP): An Extension of Servlet • Lifecycle of a JSP • Example JSP • JSP Declarations • JSP Expressions • JSP Directives • JSP Action Tags • Session Tracking using JSP • Custom Tags in JSP Java Server Pages Standard Tag Library (JSTL)
Day - 03
Lesson Java Naming and Directory Interface (JNDI) • Naming Services Overiew • Unified Heterogeneous Namespace • JNDI • JNDI Implementation Architecture • Benefits • Example of JNDI Usage Introduction to MVC and Struts ActionServlet ActionForm Action RequestProcessor Struts-config.xml
Introduction to JSF • MVC architecture • JSF basics • Introduction to Facelets • JSF Life Cycle • Managed Beans • JSF Navigations • Example JSF Introduction • Overview of Spring Technology o Shortcomings of Java EE, Spring Architecture • Spring Introduction o Managing Beans, The Spring Container, IoC, DI o Configuration Metadata - XML, @Component, AutoDetecting Beans • Dependencies and Dependency Injection (DI) o Dependency Inversion, Dependency Injection (DI) in Spring, DI Configuration - XML, @Resource o Lifecycle of a Spring Bean
Day - 04
More about Bean Properties • Working with Properties o Configuring Value Properties, Property Conversions, Setter / Constructor Injection • Spring Expression Language for Configuration • Collection Valued Properties o Configuring and using lists, sets, etc. • Additional Capabilities o Factory Methods, Bean Aliases, Definition Inheritance (Parent Beans) The Spring Container and API • ApplicationContext o ClassPathXmlApplicationContext, FileSystemXmlApplicationContext, Constructors, Usage • Resource Access - Overview, Resource Implementations • Validation o Overview, JSR-303 o Declarative Validation, @NotNull, @Size, @Min, etc o Configuration, Injection • Bean Scope and Lifecycle o Bean Scope Defined, Configuring, Inner Beans, Bean Creation Lifecycle, Lifecycle Callbacks, BeanPostProcessor, Event Handling • MessageSources o Defining and Using Resource Bundles, Localization/I18N
Day - 05
Annotation Driven Configuration in Depth • Stereotypes: @Component, @Service, @Controller, @Repository • Java EE 5 Annotation Support • Defining Custom Annotations • Autowiring o @Autowired on setters, constructors, methods, fields o Injecting resources like ApplicationContext o Fine tuning with @Qualifier • Java Based Bean Metadata (JavaConfig) o Overview - code-centric Configuration o @Confguration, @Bean, and @Value o Importing and @Import o Autowiring in Configuration Classes o Mixing XML Configuraiton and @Configuration • XML vs Annotation Based Configuration
Day - 06 Introduction to Hibernate • Issues with Persistence layers and Object-Relational Mapping (ORM) • Hibernate Overview and Benefits • Hibernate architecture overview • POJO (Plain Old Java Object) Based Mapping Getting started with Hibernate quickly • Overview of the Hibernate distribution • Configuring Hibernate o hibernate.cfg.xml file o SessionFactory configuration o Connection properties, Database dialect o Configuration class, Session Interface • "Hello World" Program for Hibernate • Mapping a Class o Persistent Entity Class, Hibernate Mapping o File, Mapping the Entity Class o Primary keys: Id property, Generated Id • Hibernate Type System • Working with sessions and Persistent Objects • Logging - log4j Overview and configuration for Hibernate Querying • Inserting and Updating Entities • HQL - Hibernate Query Language Overview • The Query Interface • Creating and working with queries • Named Queries, Projection Queries, Aggregate Queries The Persistence Lifecycle • Transaction Overview and Transactions in Hibernate
• • • • • • •
Hibernate Transaction API (in Managed and Non-managed Environments) The lifecycle of managed objects Persistent, transient, and detached objects The Persistence (Session) Context (Lifespan, Relation to Managed Objects, Propagation) Contextual Sessions Synchronization to the Database The Session as cache
Relationships • Object Relationship Overview • Mapping Collections of Value Objects • Entity Relationships: 1-N, N-1, N-N, 1-1 • Mapping Entity Relationships • Uni and Bi-directional Relationships • The Relationship "inverse" • Cascading Over Relationships • Queries Across Relationships (Lazy and Eager)
Day - 07
Queries • HQL Queries • Criteria Queries • Native SQL queries. • Advanced reporting techniques, the use of dynamic queries and how to optimize runtime fetching. Caching • Hibernate first- and second-level cache • How caching system is used in practice through examples. Hibernate and Java Persistence • Overview of Java Persistence • Relationship between Java Persistence and Hibernate • Overview of Annotations • Mapping Entities with Hibernate Annotations • The EntityManager, Persistence Context and Persistence Unit • Working with Transactions - EntityTransaction, Managed, and Unmanaged Environments • Inserts and Updates • Versioning • Relationships
Day - 08 SpringMVC MVC introduction Creating a simple application Understanding SpringMVC architecture Views, ViewResolver, Controllers
Programmatic & Declarative Validation Lab : Spring Sample Web App JDBC Support and DAO JDBC Template (Intro to Templates) Using JDBC Helper objects (SqlFunction, SqlUpdate, SqlOperation, SqlQuery) Working with Mapping SQL query to setup lightweight ORM Lab: Adding JDBC support to the application Using DAO support Lab: Using DAO support JdbcTemplate
Day - 09
Hibernate Integration with Spring • Using Spring with Hibernate o HibernateTemplate, LocalSessionFactoryBean, Hibernate Configuration, HibernateDaoSupport, o Configuring a Hibernate DAO o HibenateTemplate Query Methods, Using HibernateCallback, Using Contextual Sessions Spring Transaction (TX) Management • Intro to Spring Transaction Management o Overview, Component TX Model, TX Propagation, Declarative Transactions, TransactionManagers • Using Spring Transactions • Annotation Configured Transactions o @Transactional and its settings • XML Configured Transactions o new <tx:*> elements, Configuring tx:advice, and tx:attributes o Defining the TX advisor
Day – 10
Aspect Oriented Programming (AOP) • Overview of AOP o AOP Basics, Aspect, Joinpoint, Advice, Pointcut • Introduction to Spring AOP o Capabilities, Configuration (Annotation Based and XML), Weaving, Joinpoints • Using Aspects o Defining Advice, Configuring Pointcuts, Targets and Proxies o XML Configuration with <aop:> o AspectJ Pointcuts, Autoproxies • Using @AspectJ Annotations o @ApsectJ Annotations, Declaring Advice
Spring Security • • •
Introduction to JAAS Spring Security concepts Declarative security for spring applications
Spring Integration with Web Services • • Day – 11
Introduction to Web Services SOAP Web services
Spring Integration with Messaging and Transactions • Introduction to Messaging • Working with JMS • Transactional JMS • Distributed transaction management Spring Web Flow • • • • • •
Introduction to Spring Web Flow Authoring flow definitions View states, events and transitions Adding flow behavior working with scoped data using the Web Flow integration with JSF
Day – 12 Spring Integration with JMX Introduction to JMX Exposing spring services as Mbeans Spring Integration with Java Mail Introduction to Java Mail Java Mail vs JMS Spring integration with Java Mail Spring Integration with Scheduler Introduction to Scheduler Spring integration with Timer/ Quartz
Spring Remoting Introduction to different Protocols Spring Exports and Proxies for Remoting Exposing HttpInvoker & Rmi services Spring design Patterns & Best Practices