Get started with using the new Java MVC 1.0 framework for model, view, and controller development for building modern Java-based web, native, and microservices applications. __Beginning Java MVC__ teaches you the basics, then dives in to models, views, controllers. Next, you learn data binding, events, application types, view engines, and more. You will be given practical examples along the way to reinforce what you have learned. Furthermore, you'll work with annotations, internationalization, security, and deployment. After reading this book, you'll have the know how to build your first full Java-based MVC application. **What You Will Learn** * Discover the Java MVC 1.0 APIs and how to use them Master the Model, View and Controller design pattern * Carry out data binding * Write events * Work with view engines **Who This Book Is For** Those new to Java MVC 1.0. Some prior experience with Java programming recommended, especially with JSF or Struts. Table of Contents About the Author About the Technical Reviewer Introduction Chapter 1: About MVC: Model, View, Controller The History of MVC MVC in Web Applications MVC for Java Finally, Java MVC (JSR-371) Why MVC Where Is Hello World? Exercises Summary Chapter 2: Prerequisite: Jakarta EE/Java EE The Nature of Java for Enterprise Applications GlassFish, a Free Java Server Getting GlassFish GlassFish Shell Administration GlassFish GUI Administration GlassFish REST Interface Administration Using a Preinstalled Java Server Learning Java for Enterprise Applications RESTful Services Exercises Summary Chapter 3: Development Workflow Using Gradle as a Build Framework Using Eclipse as an IDE Installing Eclipse Configuring Eclipse Adding Java Runtimes Adding Plugins Eclipse Everyday Usage More About Gradle A Basic Gradle Project Gradle Main Concepts Standard Gradle Project Layout The Central Gradle Build File Running Gradle Tasks Gradle Tasks Explained Gradle Plugins More About Repositories More About Dependencies Changing the Project Structure The Gradle Build File Is a Groovy Script Script Variables Custom Tasks The Gradle Wrapper Multi-Project Builds Adding a Deploy Task Developing Using the Console Installing MVC Exercises Summary Chapter 4: Hello World for Java MVC Starting the Hello World Project The Hello World Model The Hello World View The Hello World Controller Using Gradle to Build Hello World Starting a Jakarta EE Server Deploying and Testing Hello World Exercises Summary Chapter 5: Start Working with Java MVC Handling User Input from Forms Exception Handling in Java MVC Non-String POST Parameters Handling Query Parameters Exercises Summary Chapter 6: In-Depth Java MVC The Model CDI in Java MVC Model Object Scopes The Simplified Model Data Container The View: JSPs JSP Basics Directives Static Content Java Scriptlets and Java Expressions Implicit Objects JavaBeans Components Expression Languages Output Variables Loops Conditional Branching Cookies The View: Facelets Facelets Files Facelets Configuration Templating via Facelets The Tag The Tag, First Variant The Tag, Second Variant The Tag The Tag The Tag The Tag The Tag The Tag The Tag The Tag An Example Facelets Project Mixing Facelets and JSTL Unified Expressions The Controller Controller Basics Getting Pages Preparing the Model Posting Data into Controllers Exercises Summary Chapter 7: In-Depth Java MVC: Part II Adding Bean Validation Injectable Context Persisting State Dealing with Page Fragments Observers Configuration Exercises Summary Chapter 8: Internationalization Language Resources Adding Localized Messages to the Session Formatting Data in the View Using JSF for Formatting Localized Data Conversion Exercises Summary Chapter 9: Java MVC and EJBs About Session EJBs Defining EJBs Accessing EJBs EJB Projects EJBs with Dependencies Asynchronous EJB Invocation Timer EJBs Exercises Summary Chapter 10: Connecting Java MVC to a Database Abstracting Away Database Access with JPA Setting Up a SQL Database Creating a Datasource Preparing the Member Registration Application Adding EclipseLink as ORM Controllers Adding Data Access Objects Updating the View Adding Entities Adding Relations Exercises Summary Chapter 11: Logging Java MVC Applications System Streams JDK Logging in GlassFish GlassFish Log Files Adding Logging Output to the Console Using the Standard Logging API for Your Own Projects Logging Levels The Logger Hierarchy and Thresholds The Logging Configuration The Logging Format Using JDK Standard Logging for Other Servers Adding Log4j Logging to Your Application Adding Log4j Server-Wide Changing the Logging Format Adding Log4j to Jakarta EE Web Applications Using Log4j in the Coding Exercises Summary Chapter 12: A Java MVC Example Application The BooKlubb Database The BooKlubb Eclipse Project The BooKlubb Infrastructure Classes Configuring BooKlubb Database Access The BooKlubb Internationalization The BooKlubb Entity Classes BooKlubb Database Access via DAOs The BooKlubb Model The BooKlubb Controller The BooKlubb View Fragment Files Landing Page Member-Related View Files Book-Related View Files Deploying and Testing BooKlubb Summary Appendix Solutions to the Exercises Chapter 1 Exercises Chapter 2 Exercises Chapter 3 Exercises Chapter 4 Exercises Chapter 5 Exercises Chapter 6 Exercises Chapter 7 Exercises Chapter 8 Exercises Chapter 9 Exercises Chapter 10 Exercises Chapter 11 Exercises Index