Core JavaServer Faces

by David Geary

Published 24 June 2004
JavaServer Faces (JSF) is the standard Java EE technology for building web user interfaces. It provides a powerful framework for developing server-side applications, allowing you to cleanly separate visual presentation and application logic. JSF 2.0 is a major upgrade, which not only adds many useful features but also greatly simplifies the programming model by using annotations and “convention over configuration” for common tasks.

 

To help you quickly tap into the power of JSF 2.0, the third edition of Core JavaServer™ Faces has been completely updated to make optimum use of all the new features. The book includes



Three totally new chapters on using Facelets tags for templating, building composite components, and developing Ajax applications
Guidance on building robust applications with minimal hand coding and maximum productivity–without requiring any knowledge of servlets or other low-level “plumbing”
A complete explanation of the basic building blocks—from using standard JSF tags, to working with data tables, and converting and validating input
Coverage of advanced tasks, such as event handling, extending the JSF framework, and connecting to external services
Solutions to a variety of common challenges, including notes on debugging and troubleshooting, in addition to implementation details and working code for features that are missing from JSF
Proven solutions, hints, tips, and “how-tos” show you how to use JSF effectively in your development projects

Core JavaServer™ Faces, Third Edition, provides everything you need to master the powerful and time-saving features of JSF 2.0 and is the perfect guide for programmers developing Java EE 6 web apps on Glassfish or another Java EE 6-compliant application servers, as well as servlet runners such as Tomcat 6.

Core HTML5 Canvas

by David Geary

Published 8 May 2012

One of HTML5’s most exciting features, Canvas provides a powerful 2D graphics API that lets you implement everything from word processors to video games. In Core HTML5 Canvas, best-selling author David Geary presents a code-fueled, no-nonsense deep dive into that API, covering everything you need to know to implement rich and consistent web applications that run on a wide variety of operating systems and devices.

 

Succinctly and clearly written, this book examines dozens of real-world uses of the Canvas API, such as interactively drawing and manipulating shapes, saving and restoring the drawing surface to temporarily draw shapes and text, and implementing text controls. You’ll see how to keep your applications responsive with web workers when you filter images, how to implement smooth animations, and how to create layered, 3D scrolling backgrounds with parallax. In addition, you’ll see how to implement video games with extensive coverage of sprites, physics, collision detection, and the implementation of a game engine and an industrial-strength pinball game. The book concludes by showing you how to implement Canvas-based controls that you can use in any HTML5 application and how to use Canvas on mobile devices, including iOS5. This authoritative Canvas reference covers 

  • The canvas element—using it with other HTML elements, handling events, printing a canvas, and using offscreen canvases
  • Shapes—drawing, dragging, erasing, and editing lines, arcs, circles, curves, and polygons; using shadows, gradients, and patterns
  • Text—drawing, positioning, setting font properties; building text controls
  • Images—drawing, scaling, clipping, processing, and animating
  • Animations—creating smooth, efficient, and portable animations
  • Sprites—implementing animated objects that have painters and behaviors
  • Physics—modeling physical systems (falling bodies, pendulums, and projectiles), and implementing tweening for nonlinear motion and animation
  • Collision detection—advanced techniques, clearly explained
  • Game development—all aspects of game development, such as time-based motion and high score support, implemented in a game engine
  • Custom controls—infrastructure for implementing custom controls; implementing progress bars, sliders, and an image panner
  • Mobile applications—fitting Canvas apps on a mobile screen, using media queries, handling touch events, and specifying iOS5 artifacts, such as app icons 

Throughout the book, Geary discusses high-quality, reusable code to help professional developers learn everything they really need to know, with no unnecessary verbiage. All of the book’s code and live demonstrations of key techniques are available at corehtml5canvas.com.


This is the eBook version of the printed book.

Based on material from the forthcoming second edition of Core JavaServer™ Faces by David Geary and Cay Horstmann, this short cut explores how to use JavaServer Faces and AJAX (Asynchronous JavaScript with XMLHttpRequest) to create rich user interfaces. Starting with a brief review of Ajax fundamentals, it goes on to cover



Implementing Ajax with a servlet in a JSF application
Using JSF phase listeners for more complex Ajax scenarios
Form completion and real-time validation
Accessing UI view state from an Ajax call
Client-side state saving and Ajax
Direct Web Remoting with DWR

Finally, after concisely explaining JSF components that wrap existing JavaScript components using Prototype, Scriptaculous, Dojo, and Rico, this Short Cut briefly explores how to use the Ajax4jsf framework to seamlessly integrate Ajax into JSF applications.

Core JSTL

by David Geary

Published 9 December 2002
Core JSTL is an in-depth examination of the JavaServer Pages Standard Tag Library (JSTL), which provides a standard set of custom tags--including tags for iteration, accessing URLs, database access, internationalization, and the manipulation and transformation of XML documents--that Web page authors and software developers can use to develop Web sites. The book illustrates JSTL's capabilities with lots of code snippet and examples. These examples are creative and practical combinations of tags you can use right now! An advanced part of the book covers JSTL configuration and integration of Java code with JSTL. JSTL defines an expression language that facilitates Web site development by providing an alternative to Java code in Web pages. The JSTL expression language also allows easy access to data such as request parameters and attributes, cookies, and HTML headers. Core JSTL examines all aspects of this powerful new addition to the JavaServer Pages standard, and is written for page authors and software developers alike. JSTL is a Java standard for developing dynamic web sites. It gives non-programmers access to powerful operations through HTML-like tags.