Corso di “Sviluppo di applicazioni Web”

Slides:



Advertisements
Similar presentations
Introduction to NHibernate By Andrew Smith. The Basics Object Relation Mapper Maps POCOs to database tables Based on Java Hibernate. V stable Generates.
Advertisements

19 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Developing Web Services.
Coding Basics - Deferred Binding. Deferred Binding is a feature of the GWT compiler works by generating many versions of code at compile time, only one.
Intermediate Spring Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
Fast Track to ColdFusion 9. Getting Started with ColdFusion Understanding Dynamic Web Pages ColdFusion Benchmark Introducing the ColdFusion Language Introducing.
Web programming for project students Dr Jim Briggs.
Introduction to Java web programming Dr Jim Briggs JWP intro1.
Java Enterprise Edition Java Web Development Structure of a web project Introduction to Web Applications The first project Introduction to Java Web Development.
Address - #22, 1 st Floor, Station View Road, Kodambakkam, Chennai JTech Soft Solutions Website:
The Spring Framework: A brief introduction to Inversion of Control James Brundege
CSE446 S OFTWARE Q UALITY M ANAGEMENT Spring 2014 Yazılım ve Uyguluma Geliştirme Yöneticisi Orhan Başar Evren.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
|Tecnologie Web L-A Anno Accademico Laboratorio di Tecnologie Web Sviluppo di applicazioni web Servlet
Intermediate Spring Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic.
2007 JavaOne SM Conference | Session BOF-4181 | BOF-4181 Migrating a Spring/Hibernate Application to Java Platform, Enterprise Edition (Java EE) 5 Adrian.
BEST PRACTICES - Java By Configuration Use global-forwards/results Helps to avoid duplicate jsp files and redundancy forward mapping.
Configuration Management and Server Administration Mohan Bang Endeca Server.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
Entity Java Beans Jorg Janke Open Source ERP & CRM.
CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES LECTURE 5_1 George Koutsogiannakis/ Summer
Geomajas Framework By: Nikhil Morajkar Chaitanya KSR
OpusCollege and the use of Spring and iBatis
Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software.
JBoss at Work JAW Motors Application Chapter 1-3 Jeff Schmitt October 9, 2006.
Struts J2EE web application framework “ Model 2 ” Model View Controller Controller Servlet Key features XML metadata Struts taglib Simplified form validation.
Presentation. Recap A multi layer architecture powered by Spring Framework, ExtJS, Spring Security and Hibernate. Taken advantage of Spring’s multi layer.
J2EE Overview Web Programming CSCI J2EE multi-tier architecture Servlet: Java class loaded into Web server JSP page: enhanced HTML page that is.
Ch 2 – Application Assembly and Deployment COSC 617 Jeff Schmitt September 14, 2006.
Andrew S. Budarevsky Adaptive Application Data Management Overview.
Topic Java EE installation (Eclipse, glassfish, etc.) Eclipse configuration for EE Creating a Java Web Dynamic Project Creating your first servlet.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 14 Database Connectivity and Web Technologies.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Spring Remoting Simplifying.
.  A multi layer architecture powered by Spring Framework, ExtJS, Spring Security and Hibernate.  Taken advantage of Spring’s multi layer injection.
Intermediate Spring Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic.
Sakai WebApp Structure
ASP.NET Web Services.  A unit of managed code installed under IIS that can be remotely invoked using HTTP.
Spring and DWR Frameworks for Rich Web Enterprise Application Thomas Wiradikusuma Presentation to the 20 th.
JAVA BEANS JSP - Standard Tag Library (JSTL) JAVA Enterprise Edition.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
JAVA EE 6 Best Practices for Migrating Spring to WTF ?!?
Dependency Injection JAVA EE - Spring Framework. Inner Beans As you know Java inner classes are defined within the scope of other classes, similarly,
Presentation.
Kansas City Java User’s Group Jason W. Bedell July 12, 2006
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
Modern Programming Language. Web Container & Web Applications Web applications are server side applications The most essential requirement.
Rich Internet Applications 2. Core JavaScript. The importance of JavaScript Many choices open to the developer for server-side Can choose server technology.
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
15 Copyright © 2004, Oracle. All rights reserved. Adding JAAS Security to the Client.
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
Introduction – ORM, Helloworld Application
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Message Framework Topic subscribe for javascript/flex client.
EJB Enterprise Java Beans JAVA Enterprise Edition
Google Code Libraries Dima Ionut Daniel. Contents What is Google Code? LDAPBeans Object-ldap-mapping Ldap-ODM Bug4j jOOR Rapa jongo Conclusion Bibliography.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
J2EE Lecture 6: Spring – IoC and Dependency Injection
Field of Dreams An Online Sporting Goods Marketplace
Google Web Toolkit Tutorial
Java Servlets By: Tejashri Udavant..
JavaServer Pages (JSP)
Knowledge Byte In this section, you will learn about:
Sakai WebApp Structure
Understanding and Designing with EJB
Objectives In this lesson you will learn about: Need for servlets
Understanding and Designing with EJB
Developing and testing enterprise Java applications
J2EE Lecture 13: JMS and WebSocket
Enterprise Java Beans.
Presentation transcript:

Corso di “Sviluppo di applicazioni Web” Docente: Giovanni Grasso - Hibernate and GWT integration

Spring WebApplicationContext Spring ApplicationContext can be loaded declaratively within the context of an application server. J2EE standard provides mechanism for defining context parameters and application listeners in the Web deployment descriptor file (web.xml). <context-param> <param-name> contextConfigLocation </param-name> <param-value> /WEB-INF/applicationContext.xml </param-value> </context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener>

Hibernate + GWT …. problems Hibernate POJO are not real POJO. The persistence library adds a lot of needed information, such as session factory, by creating a dynamic proxy (with CGLIB or Javassist) around your instance. When you manipulate an Hibernate POJO, you do not do it with an instance of your class GWT can only serialize (to Javascript) only a subset of the JRE (basically, the java.lang and the java.util packages). Hibernate defines its own implementation of the Java collections (PersistentList, PersistentSet and PersistentMap), of course not supported by GWT serialization process.

hibernate4gwt hibernate4gwt permits you to use your Hibernate POJO (and especiallay the partially loaded ones) in the GWT client side code without pain. hibernate4gwt allows different configurations, depending on your needs and constraints. stateless mode (the default) : your server remains stateless and do not store any extra information. Your domain classes will have to inherit from LazyPojo to store lazy attributes.

Hibernate4gwt - How to Download the hibernate4gwt distribution. All the dependency libraries are included in the "lib" directory (link) Edit your gwt xml file to inherit from hibernate4gwt and declare the domain package <inherits name='net.sf.hibernate4gwt.Hibernate4Gwt15'/> <inherits name='net.sf.hibernate4gwt.emul.java5.ejb3.Ejb3'/> <source path='domain'/> All domain classes inherit from “net.sf.hibernate4gwt.pojo.java5.LazyPojo” public class User extends LazyPojo

Hibernate4gwt - How to HibernateBeanManager initialisation applicationContext.xml <bean id="hibernateBeanManager“ class="net.sf.hibernate4gwt.core.HibernateBeanManager">   <property name="sessionFactory" ref="sessionFactory" /> </bean> RemoteService Just make your RemoteService implementation inherits from the HibernateRemoteService instead public class UserRemoteImpl extends HibernateRemoteService implements UserRemote

Hibernate4gwt - lazy properties Lazy associations are not loaded by Hibernate/JPA Hibernate4GWT replaces it with null. In DAO methods explicitly call the XXX getter on server-side (to force association loading) or change your query to "from MyItem as item inner join fetch item.xxx …”