j2ee concepts

What are J2EE Concepts

Table of Contents

J2EE (Java 2 Platform Enterprise Edition) is a platform-independent environment used for configuring web-based enterprise applications. It contains several API, protocols, and run time environment for the development of network-based web services. It creates multi-tiered applications, large scale, reliable, and secure network applications.

Advantages of J2EE:

  • Enterprise applications are reliable, secure, and scalable.
  • It increases the productivity of a programmer as it is easy to learn and use with the help of the Java language.
  • It can operate on multiple platforms.
  • It is portable across different machines, vendors, and servers.

Services of J2EE:

  • J2EE supports pure HTML as well as Java Applets. It is based on Java Server Pages and Servlet code to create applications.
  • EJB (Enterprise Java Beans) provides a separate layer for storing the logic.
  • JDBC (Java Database Connectivity) creates a connection between an application and a database.

J2EE Tiered Applications:

J2EE allows multi-tiered applications where each tier performs a different functionality.

  1. Client Tier: In this tier, a client makes a request to the server. The request is sent to the server by the client, and the server then returns the corresponding response. Requests can either be made from a browser, an application, or another server.
  2. Web Tier: This tier manages the client and business tier interaction. Web Tier consists of JSP, Servlet, Expression Lang, Java Beans Components, etc.
  3. Business Tier: It is responsible for the business logic of an application. It contains EJB (Enterprise Java Beans), Java Persistence API entities, Restful Web Services, etc.
  4. Enterprise Information Tier: It is available on the other machine other than the device containing the J2EE application. It comprises of Java Persistence API, JDBC (Java Database Connectivity) API, JTA (Java Transaction) API, and Java EE Connector Architecture.

Servlet

Servlet is used to create a web application in Java. It is an API that contains various classes and interfaces. It is a web component used to create dynamic web pages. It reads the data (both explicit and implicit) sent by the client (browser) (it may be any form or an applet application) and implicit HTTP requests, including cookies, media types, processes the data, generates the result, and again sent this result to the client.

Advantages of Servlet:

  • It provides better performance by creating multiple threads for each request.
  • It can also handle complex requests obtained from the webserver.
  • It uses Java; hence it is portable, platform-independent, and secure.
  • It is robust as we do not need to worry about the memory leak, garbage collection, etc. as JVM manages everything.

JSP

JSP is a server-side programming technology in Java that is used to create dynamic, platform-independent web applications similar to Servlet. It can be called as an extension of Servlet because it provides more functionality than Servlet like Expression Language, JSTL, etc.

Advantages of JSP:

  • It contains various other features like implicit objects, predefined tags, expression language, etc.
  • It is easy to maintain because business logic is separated from presentation logic.
  • After any modification in the JSP page, there is no need to recompile or redeploy the project. 
  • Coding is less because we use many predefined tags, action tags, etc.
  • Exception Handling is easy in JSP.
  • It can easily connect the website to the database.

Expression Lang

JSP Expression Lang (EL) helps in the easy accessibility of data stored in JavaBean components. In EL, we can use integers, string, floating numbers, etc. Both arithmetic and logical expressions can be created with the help of EL.

Syntax: 

${expression}

  • EL makes the integration of the server-side state with presentation output easily.
  • EL is written within ${, and }.
  • EL can directly be used in the static text as well as template text.
  • EL can be used in any standard or custom action attribute.

One Response

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share this article
Subscribe
By pressing the Subscribe button, you confirm that you have read our Privacy Policy.
Need a Free Demo Class?
Join H2K Infosys IT Online Training
Enroll Free demo class