© Dave Wolf, A.J. Henley 2017

Dave Wolf and A.J. Henley, Java EE Web Application Primer, https://doi.org/10.1007/978-1-4842-3195-1_9

9. The Controller

Dave Wolf and A. J. Henley2

(1)New York, USA

(2)Washington, D.C., District of Columbia, USA

The controller layer in our application contains code to handle application-specific logic. This includes concerns such as receiving data from web pages, sending data to the classes in the service layer, and sending the user the next servlet or JSP as appropriate. The controller does not access the database directly. The controller finds out what needs to be done, then finds the right class in the service layer or presentation layer and calls on that class to do its work. In our application, most of the code ...

Get Java EE Web Application Primer: Building Bullhorn: A Messaging App with JSP, Servlets, JavaScript, Bootstrap and Oracle now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.