I'm trying to learn Java EE, starting with Servlets and JSPs in an MVC architecture. I know Servlets are often used as the controller and JSPs are often used as the view, and that these both interact with the model, the back end java application on the server. The question I'm asking is what the back end application would consist of. Is it nothing more than a simple JSE application that uses Servlets and JSPs as the interface?
Also, considering I'm asking what's probably a simple question, is there a good Java EE MVC tutorial I could use?
MVC stands for Model View and Controller. It is a design pattern that separates the business logic, presentation logic and data. Controller acts as an interface between View and Model. Controller intercepts all the incoming requests. Model represents the state of the application i.e. data.
All of the APIs defined in the Java Standard Edition, or Java SE, are also offered to Java EE applications. Java EE does not compete with Java SE, but is instead a superset of APIs that builds upon the foundation provided by Java SE and the standard Java Development Kit (JDK).
Java Platform, Enterprise Edition (Java EE) is the standard in community-driven enterprise software. Java EE is developed using the Java Community Process, with contributions from industry experts, commercial and open source organizations, Java User Groups, and countless individuals.
The Java EE components all run on the server side, either on full Java EE servers like GlassFish, JBoss, WebLogic, or WebSphere, or on servers like Tomcat that just support servlets and JSPs.
In Java EE the MVC model can be thought of as a "domain model", ie the Java objects representing the entities that are important to your application. For instance a shopping application would have domain objects representing items for purchase, shopping carts, credit cards, mailing addresses, accounts, reviews, and so forth. Often these domain objects come from persistent storage such as a relational database.
Java EE's Java Persistence API is designed to handle the mapping between the Java domain model objects and the relational database tables used to make the objects persistence. Hibernate is one implementation of a JPA "object-relational mapper" (ORM).
Java EE is much more than that. To take just one example, it defines an ultra-reliable messaging service (Java Message Service) that back end application components use to communicate with each other.
As you explore Java EE, do give some thought to simpler and more productive alternatives like Ruby-on-Rails, LAMP stacks, Microsoft's .NET platform, and "light-weight" Java approaches like Spring/Hibernate. Richard Monson-Haefel, who wrote O'Reilly's very successful "Enterprise JavaBeans 3.0" (the fifth edition) and "Java Message Service", even goes so far as to claim that Java EE is "intimidating" to developers and will be eclipsed by these other approaches.
A good place to get a wider perspective is Todd Hoff's wonderful blog at http://highscalability.com/
Similar question has been asked on SO, i think.
Here's a good tutorial to get you started.
http://courses.coreservlets.com/Course-Materials/csajsp2.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With