You are previewing Google Web Toolkit 2 Application Development Cookbook.
O'Reilly logo
Google Web Toolkit 2 Application Development Cookbook

Book Description

Over 70 simple but incredibly effective practical recipes to develop web applications using GWT with JPA , MySQL and i Report

  • Create impressive, complex browser-based web applications with GWT 2

  • Learn the most effective ways to create reports with parameters, variables, and subreports using iReport

  • Create Swing-like web-based GUIs using the Ext GWT class library

  • Develop applications using browser quirks, Javascript,HTML scriplets from scratch

  • Part of Packt's Cookbook series: Each recipe is a carefully organized sequence of instructions to complete the task as efficiently as possible

  • In Detail

    GWT 2 radically improves web experience for users by using existing Java tools to build no-compromise AJAX for any modern browser. It provides a solid platform so that other great libraries can be built on top of GWT. Creating web applications efficiently and making them impressive, however, is not as easy as it sounds. Writing web applications for multiple browsers can be quite tasking. In addition, building, reusing, and maintaining large JavaScript code bases and AJAX components can be difficult.

    GWT 2 Application Development Cookbook eases these burdens by allowing developers to quickly build and maintain complex yet highly efficient JavaScript front-end applications in the Java programming language . It tells you how to make web experience all the more thrilling and hassle free, using various tools along with GWT SDK.

    This book starts with developing an application from scratch. Right from creating the layout of the home page to home page elements including left and right sidebars, to placing tree like navigational menu, menu bars, tool bars, banners, footers are discussed with examples.

    You will see how to create forms using the Ext GWT library widgets and handle different types of events. Then you will move on to see how to design a database for sales processing systems and learn to create the database in MySQL with the help of easy-to-follow recipes.

    One of the interesting topics of this book is using JPA in GWT. Using the JPA object in GWT is a challenge. To use them perfectly, a mechanism to convert the JPA object into plain object and vice versa is required. You will see recipes to use entity classes, entity managers, and controller classes in GWT application. You will efficiently create reports with parameters, variables and subreports, and get the report output in both HTML and PDF format using real-world recipes.

    You will then learn to configure the GlassFish server to deploy a GWT application with database. Finally, learn how to trace speed and improve perfomance in web applications using tracing techniques.

    Create impressive web applications with tool bars, menus, multiple windows, and more with this step-by-step guide.

    Table of Contents

    1. Google Web Toolkit 2 Application Development Cookbook
      1. Google Web Toolkit 2 Application Development Cookbook
      2. Credits
      3. About the Author
      4. About the Reviewers
      5. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Errata
          2. Piracy
          3. Questions
      6. 1. Setting up the GWT Environment in NetBeans
        1. Introduction
        2. Installing JDK
          1. Getting ready
          2. How to do it...
        3. Installing GWT SDK
          1. Important features
          2. Getting ready
          3. How to do it...
        4. Installing GlassFish
          1. Getting ready
          2. How to do it...
          3. There's more...
          4. See also
        5. Installing MySQL server
          1. Getting ready
          2. How to do it...
        6. Configuring the MySQL Server
          1. Getting ready
          2. How to do it...
        7. Installing NetBeans IDE
          1. Getting ready
          2. How to do it...
        8. Adding the GlassFish server in NetBeans
          1. Getting ready
          2. How to do it...
          3. There's more...
        9. Installing the GWT4NB plugin in NetBeans
          1. Getting ready
          2. How to do it...
        10. Creating a GWT project in NetBeans
          1. Getting ready
          2. How to do it...
          3. How it works...
            1. Directory and file structure
            2. Running the project
        11. Adding Ext GWT
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
      7. 2. Creating Home Page with Panels and Menus
        1. Introduction
        2. Creating the home page layout class
          1. Getting ready
          2. How to do it...
            1. How it works...
            2. There's more...
              1. Setting the size of the panel
              2. Showing or hiding header in the content panel
              3. BorderLayoutData
              4. Classes and packages
            3. See also
        3. Adding the banner
          1. Getting ready
          2. How to do it...
            1. How it works...
            2. See also
        4. Adding menus
          1. How to do it...
            1. How it works...
            2. See also
        5. Creating the left-hand sidebar
          1. How to do it...
            1. How it works...
            2. See also
        6. Creating the right-hand sidebar
          1. How to do it...
            1. How it works...
            2. See also
        7. Creating the main content panel
          1. How to do it...
            1. How it works...
            2. See also
        8. Creating the footer
          1. How to do it...
            1. How it works...
              1. VerticalPanel
              2. Setting alignment for VerticalPanel
            2. See also
        9. Using the HomePage instance in EntryPoint
          1. Getting ready
          2. How to do it...
            1. How it works...
              1. EntryPoint
              2. RootPanel
              3. Class and packages
            2. See also
      8. 3. Forms with Layout and Widgets
        1. Introduction
        2. Using widgets
          1. How to do it...
        3. Using TextField
          1. How to do it...
          2. How it works...
          3. There's more...
            1. Using TextField for password
            2. Creating a read-only TextField
        4. Using a simple combo box
          1. How to do it...
          2. How it works...
        5. Using the radio button
          1. How to do it...
        6. Using DateField
          1. How to do it...
          2. How it works...
        7. Creating a simple form
          1. How to do it...
          2. How it works...
        8. Creating a form with two columns
          1. How to do it...
          2. How it works...
        9. Creating a TabPanel to show forms as tabs
          1. Getting ready
          2. How to do it...
            1. How it works...
            2. See also
        10. Creating a navigation sidebar with Accordion layout
          1. Getting ready
          2. How to do it...
            1. How it works...
            2. See also
      9. 4. Handling your First Events
        1. Introduction
        2. Handling ButtonEvent
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        3. Using the SelectionChange event
          1. How to do it...
          2. How it works...
          3. See also
        4. Handling FieldEvent
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        5. Working with the KeyUp event
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        6. Handling ChangeEvent
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        7. Working with MenuEvent
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        8. Using FocusEvent
          1. How to do it...
          2. How it works...
          3. See also
        9. Handling the DatePicker event
          1. Getting ready
          2. How to do it...
          3. How it works...
            1. See also
      10. 5. Creating Database for Sales Processing
        1. Introduction
          1. Designing the database for sales processing
        2. Creating the database
          1. Getting ready
          2. How to do it...
          3. There's more...
            1. Creating database using MySQL Command Line Client
          4. See also
        3. Creating tables with primary key
          1. How to do it...
            1. Creating tables from MySQL Command Line Client
          2. See also
        4. Defining foreign keys
          1. Getting ready
          2. How to do it...
          3. There's more...
            1. Creating all the other tables using MySQL Query Browser
            2. Creating all the other tables in Command Client
        5. Backing up database
          1. How to do it...
          2. How it works...
          3. See also
        6. Restoring database
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
      11. 6. Managing Entities using JPA
        1. Introduction
          1. JPA in GWT
          2. Uses
        2. Creating a database connection in NetBeans
          1. Getting ready
          2. How to do it...
            1. Direct URL Entry
        3. Creating a persistence unit
          1. Getting ready
          2. How to do it...
          3. How it works...
            1. EclipseLink
              1. EclipseLink JPA
            2. Data source
            3. persistence.xml
            4. sun-resources.xml
        4. Creating entity classes from the database
          1. Getting ready
          2. How to do it...
          3. How it works...
            1. Named query
            2. Entity classes
              1. Sales.java
              2. SalesDetails.java
              3. SalesDetailsPK.java
        5. Creating controller classes
          1. Getting ready
          2. How to do it...
          3. How it works...
            1. Entity manager
            2. Entity manager factory
            3. Controller class for sales entity
              1. Importing packages
              2. Defining a constructor
              3. Creating the entity manager
              4. Defining a method to persist object
              5. Defining a method to edit object
              6. Defining method to remove object
              7. Defining methods for finding objects
      12. 7. Communicating with the Server using GWT RPC
        1. Introduction
        2. Creating DTO classes
          1. Getting ready
          2. How to do it...
        3. Mapping entity classes and DTOs
          1. Getting ready
          2. How to do it...
          3. There's more...
        4. Creating the GWT RPC Service
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Defining an RPC method to persist objects
          1. Getting ready
          2. How to do it...
            1. How it works...
        6. Calling the RPC method from Client UI
          1. How to do it...
          2. How it works...
        7. Finding an entity
          1. How to do it...
            1. How it works...
        8. Updating an entity
          1. How to do it...
            1. How it works...
        9. Deleting an entity
          1. How to do it...
            1. How it works...
        10. Managing a list for RPC
          1. How to do it...
            1. How it works...
            2. See also
        11. Authenticating a user through username and password
          1. Getting ready
          2. How to do it...
            1. How it works...
      13. 8. Reporting with iReport
        1. Introduction
          1. Important features
        2. Installing iReport plugins in NetBeans
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Creating a report
          1. How to do it...
          2. How it works...
        4. Adding a parameter in a report
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Adding a subreport
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Adding a variable
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Showing a report in the GWT application as HTML
          1. Getting ready
          2. How to do it...
            1. How it works...
        8. Creating HTML report viewer
          1. How to do it...
            1. How it works...
        9. Calling HtmlReportViewer
          1. Getting ready
          2. How to do it...
          3. How it works...
        10. Showing a report in a GWT application as PDF
          1. How to do it...
            1. How it works...
        11. Creating a PDF report viewer
          1. How to do it...
            1. How it works...
        12. Calling PdfReportViewer
          1. Getting ready
          2. How to do it...
          3. How it works...
      14. 9. Deploying a GWT Application
        1. Introduction
        2. Building a project and creating the WAR file
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Deploying on the GlassFish Server from NetBeans
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Creating the JDBC Connection Pool in GlassFish
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Creating a JDBC Resource in GlassFish Server
          1. Getting ready
          2. How to do it...
        6. Deploying the WAR file in the GlassFish Server
          1. Getting ready
          2. How to do it...
          3. How it works...
      15. 10. Using Speed Tracer
        1. Introduction
        2. Installing Speed Tracer
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Running Speed Tracer
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Analyzing event details
          1. Getting ready
          2. How to do it...
          3. See also
        5. Analyzing network
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        6. Understanding hints
          1. Getting ready
          2. How to do it...
          3. See also