Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><sup><sup>(Updated Mar 2018)</sup></sup></p> <blockquote> <p><em>What exactly do I need to learn?</em></p> </blockquote> <p>I assume that you're already familiar with client side technologies like <a href="http://htmldog.com/guides/html/" rel="noreferrer">HTML</a>, <a href="http://htmldog.com/guides/css/" rel="noreferrer">CSS</a> and <a href="http://htmldog.com/guides/javascript/" rel="noreferrer">JS</a>, so I won't go in detail with that. I also assume that you're already familiar with basic Java. Follow Oracle's <a href="http://docs.oracle.com/javase/tutorial/" rel="noreferrer">The Java Tutorials</a> and if possible, go get a <a href="http://www.amazon.com/s?field-keywords=oca%20java" rel="noreferrer">OCA book</a> or course as well.</p> <p>Then you can start with JSP/Servlet to learn the basic concepts of Java web development. Good tutorials can be found in Oracle's <a href="http://docs.oracle.com/javaee/5/tutorial/doc/bnadp.html" rel="noreferrer">Java EE 5 tutorial part II chapters 3 - 8</a> and at Coreservlets.com (<a href="http://courses.coreservlets.com/Course-Materials/csajsp2.html" rel="noreferrer">Beginner-Intermediate</a> and <a href="http://courses.coreservlets.com/Course-Materials/msajsp.html" rel="noreferrer">Advanced, also JDBC</a>). Note that since Java EE 6, <a href="https://stackoverflow.com/questions/4845032/wheres-the-official-jsp-tutorial">JSP is removed from the Java EE tutorial in favor of JSF</a> and that JSP has basically not changed since then. That's why you could safely use the fairly old Java EE 5 tutorial for this. Most important thing with regard to JSP is the fact that writing plain Java code in JSP files using <code>&lt;%</code> scriptlets <code>%&gt;</code> is officially discouraged since 2003. See also <a href="https://stackoverflow.com/questions/3177733/how-to-avoid-java-code-in-jsp-files">How to avoid Java code in JSP files?</a> So any tutorials which still cover scriptlets should be skipped as they will definitely take you into a downward spiral of learning bad practices.</p> <p>We have also nice wiki pages about <a href="https://stackoverflow.com/tags/jsp/info">JSP</a>, <a href="https://stackoverflow.com/tags/servlets/info">Servlets</a>, <a href="https://stackoverflow.com/tags/jstl/info">JSTL</a> and <a href="https://stackoverflow.com/tags/el/info">EL</a> where you can learn the essentials and find more useful links.</p> <hr> <blockquote> <p><em>Tomcat seems to be a good web server for Java.</em></p> </blockquote> <p>It is. It is however limited in capabilities. It's basically a barebones servlet container, implementing only the JSP/Servlet parts of the huge Java EE API. If you ever want to go EJB or JPA, then you'd like to pick another, e.g. <a href="http://wildfly.org" rel="noreferrer">WildFly</a>, <a href="http://tomee.apache.org/" rel="noreferrer">TomEE</a>, <a href="http://payara.fish" rel="noreferrer">Payara</a>, <a href="https://developer.ibm.com/wasdev/downloads/" rel="noreferrer">Liberty</a>, <a href="http://www.oracle.com/technetwork/middleware/weblogic/overview/index.html" rel="noreferrer">WebLogic</a>, etc. Otherwise you have to use Spring instead of Java EE. It's namely not possible to install EJB in a barebones servlet container without modifying the core engine, you'd in case of Tomcat basically be reinventing TomEE. See also <a href="https://stackoverflow.com/questions/7295096">What exactly is Java EE?</a></p> <hr> <blockquote> <p><em>I know there is Hibernate for an ORM.</em></p> </blockquote> <p>Previously, during the J2EE era, when JPA didn't exist and EJB2 was terrible, Hibernate was a standalone framework and often used in combination with Spring to supplant EJB. Since the introduction of JPA in Java EE 5 (2006), Hibernate has become a JPA implementation. You can learn JPA at <a href="https://javaee.github.io/tutorial/partpersist.html" rel="noreferrer">Java EE tutorial part VIII</a>. Also, EJB3 was much improved based on lessons learnt from Spring. See also <a href="https://stackoverflow.com/questions/18369356">When is it necessary or convenient to use Spring or EJB3 or all of them together?</a></p> <hr> <blockquote> <p><em>Does Java have MVC? What about JSP? Can MVC and JSP be together? JavaBeans?</em></p> </blockquote> <p><a href="https://stackoverflow.com/questions/5003142">You can</a>, but that's a lot of <a href="https://stackoverflow.com/questions/3541077/design-patterns-web-based-applications/">reinvention of the wheel</a> when it comes to tying the model with the view (conversion, validation, change listeners, etc). Java EE's MVC framework is called <a href="https://stackoverflow.com/tags/jsf/info">JSF</a>. Prior to Java EE 6 it used to run on JSP, which is a fairly legacy view technology. JSP is been replaced by <a href="https://stackoverflow.com/tags/facelets/info">Facelets</a>. You can learn JSF at <a href="https://javaee.github.io/tutorial/partwebtier.html" rel="noreferrer">Java EE tutorial part III chapters 7 - 17</a>. You can by the way also use JSF on Tomcat, you only have to install it separately. Installation instructions can be found at <a href="https://github.com/javaserverfaces/mojarra/blob/master/README.md" rel="noreferrer">Mojarra homepage</a>. WildFly, TomEE, Payara, Liberty, WebLogic, etc as being a complete Java EE implementation already provide JSF (and CDI, BV, JSONP, JAX-RS, EJB, JPA, etc) out the box, so you don't need to install it separately. See also <a href="https://stackoverflow.com/questions/8081234/how-to-properly-install-and-configure-jsf-libraries-via-maven">How to properly install and configure JSF libraries via Maven?</a></p> <hr> <blockquote> <p><em>Maybe a book that covers all of these?</em></p> </blockquote> <p>There are several books. I would recommend to start with a book <a href="https://www.amazon.com/s?field-keywords=java+ee&amp;sort=date-desc-rank" rel="noreferrer">focused on Java EE in general</a>, a book <a href="https://www.amazon.com/s?field-keywords=javaserver+faces&amp;sort=date-desc-rank" rel="noreferrer">more focused on JSF</a>, and a book <a href="https://www.amazon.com/s?field-keywords=java+jpa+persistence&amp;sort=date-desc-rank" rel="noreferrer">more focused on JPA</a>. Ensure that you choose the most recent book covering the subject. Thus not an old book for Java EE 5 or JSF 1.0 or so.</p> <p>Last but not least, please ignore code snippet scraping sites maintained by amateurs with primary focus on advertisement income instead of on teaching, such as roseindia, tutorialspoint, javabeat, journaldev, javatpoint, codejava, etc. They are easily recognizable by disturbing advertising links/banners and JSP code snippets containing <em>scriptlets</em>.</p> <h3>See also:</h3> <ul> <li><a href="https://stackoverflow.com/questions/2095397/what-is-the-difference-between-jsf-servlet-and-jsp">What is the difference between JSF, Servlet and JSP?</a></li> <li><a href="https://stackoverflow.com/questions/3106452/how-do-servlets-work-instantiation-shared-variables-and-multithreading">How do servlets work? Instantiation, sessions, shared variables and multithreading</a></li> <li><a href="https://stackoverflow.com/questions/4421839/what-is-the-need-of-jsf-when-ui-can-be-achieved-from-css-html-javascript-jquery/">What is the need of JSF, when UI can be achieved from CSS, HTML, JavaScript, jQuery?</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload