Application
Putting it all together: persistence, filters, security, errors, and deployment.
Complete Application with Java EE
The previous six lessons covered each piece separately. A real application is what remains when you put them together, and assembly raises questions that studying the pieces one at a time doesn't reveal.
Where does the database connection live? Certainly not in a DriverManager.getConnection() called on every request: opening a TCP connection, authenticating, and negotiating takes ten to fifty milliseconds, multiplied by the number of requests. How does a user stay authenticated across thirty pages without every servlet copying the same check? How does an exception three levels deep become a readable error page rather than a Java stack trace handed to the visitor?
This lesson builds a task management application — small enough to fit in one lesson, complete enough to raise all of these problems. You'll see the connection pool configured at the server level, a filter chain that handles encoding, authentication, and logging before any servlet runs, centralized error handling, and the final deployment.
One last word on positioning, now that you've seen everything. What you've just learned is the foundation on which all of Java web development is built, and it still runs a considerable share of enterprise applications in production. You can now maintain, debug, and evolve this code. You also know that implementing it requires a lot of manual plumbing: wiring dependencies, writing the routing table, converting each parameter. Spring Boot automates this plumbing, and it's what you would turn to for a new project. The difference, from now on, is that you'll know what it automates.
Comments
Comments are powered by GitHub Discussions
Sign in with GitHub to join the discussion