Software Engineering a.a. 2016-2017 Introduction to Java Enterprise Edition Alessandro Fiore Università del Salento Roadmap ■ Java Enterprise Edition ■ Tomcat ■ Eclipse ■ Web application development Introduction to Java EE 2 Alessandro Fiore Java EE ■ Java – Main technology but not only ■ EE = Enterprise Edition – Performance – Distributed architecture – Multitier architecture – Secure – Reliable – Transactional Introduction to Java EE 3 Alessandro Fiore Java EE Application Components ■ Java EE is based on four fundamental technologies called components. They are: – Java servlets – Java Server Pages (JSP) – Enterprise JavaBeans (EJB) – Applets ■ And other support technologies: – Java Naming and Directory Interface (JNDI) – Java DataBase Connectivity (JDBC) – Java Remote Method Invocation (RMI) – Java Messaging Service – Java IDL Introduction to Java EE 4 Alessandro Fiore Application Server ■ An Application Server provides the Java EE main services. That are: – Running environment – Support functionalities – Infrastructure ■ AS Open Source: – JBoss – WebLogic – Geronimo – WebSphere – Tomcat * Introduction to Java EE 5 Alessandro Fiore Servlet API ■ The Servlet API provides a mechanism in order to extend the server Web for generating dynamically contents ■ The Servlet API is often specific and integrated with the Application Server. A Servlet API malfunction determines a crash of the entire Server Web Introduction to Java EE 6 Alessandro Fiore Apache Tomcat ■ Apache tomcat is an open source web server written in Java ■ Current version: 8.x ■ Link for downloading: http://tomcat.apache.org/ ■ Components – Catalina (Servlet Container) – Jasper (JSP Engine) – Coyote (HTTP Connector) Introduction to Java EE 7 Alessandro Fiore Why Apache Tomcat is not an AS ■ Tomcat is not properly an Application Server. ■ Tomcat provides the following services: – JNDI*; – JAAS; – SOA* (Axis); * Not compliant with Java EE specifications – JSP/servlet/JSF; – JDBC; – Cluster; – Datasource*. ■ Missing services: – EJB; – JMS; – JCA; – JTA; – SOA (JAX-RPC, SAAJ, JAX-WS); – JPA; – CORBA/RPC. Introduction to Java EE 8 Alessandro Fiore Eclipse ■ “Eclipse, an extensible development platform and application frameworks for building software” ■ Link for downloading: http://www.eclipse.org/downloads/ ■ Install Eclipse for Java EE developer ■ Current version: Eclipse Neon Introduction to Java EE 9 Alessandro Fiore Workbench Introduction to Java EE 10 Alessandro Fiore Workspace ■ The Workspace is able to manage one or more projects ■ The projects are folders in the file system ■ Project Explorer permits you to browse the projects Introduction to Java EE 11 Alessandro Fiore Perspective ■ Perspective includes views and editors ■ Different perspectives can be used for managing several operations ■ The workbench provides: – Extension Point to define new perspectives ■ Eclipse natively includes many perspectives – for example: Resource, Debug, Web, … Introduction to Java EE 12 Alessandro Fiore Configure Tomcat withEclipse ■ Menu File->New->Other->Server Introduction to Java EE 13 Alessandro Fiore Create a Web Application with Eclipse ■ Menu File->New->Other->Dynamic Web Project Introduction to Java EE 14 Alessandro Fiore Experiments ■ Eclipse Nion ■ Apache Tomcat 8.x ■ Web application and servlet Introduction to Java EE 15 Alessandro Fiore