logo

Enabling Competence & Security – J2EE.

Java 2 Platform, Enterprise Edition or J2EE is one of the largest enterprise Oracle’s product. The J2EE platform provides an API i.e. (Application programming interface) and runtime environment for developing and running java enterprise software, including network and web services. J2EE extends the Java Standard Edition (Java SE),providing an API for web services, object relational mapping, distributed and multi-tier architectures,. J2EE is a platform-independent, Java-based environment from Sun for developing Web-based enterprise applications online.

The J2EE web profile comprises the following tools:-
• Servlet 3.0
• JavaServer Pages (JSP)
• Unified Expression Language (EL)
• Debugging Support for Other Languages (JSR-45)
• JavaServer Pages Standard Tag Library (JSTL)
• JavaServer Faces (JSF)
• Java API for JSON Processing (JSON-P)
• Common Annotations for the Java Platform (JSR-250)
• Enterprise JavaBeans (EJB)
• Java Transaction API (JTA)
• Java Persistence API (JPA)
• Bean Validation
• Managed Beans
• Interceptors
• Contexts and Dependency Injection for the Java EE Platform
• Dependency Injection for Java

Further, J2EE supports pure HTML, as well as Java applets and applications. It depends on JSP (Java Server Pages) and Servlet to create HTML or other formatted data.Lets Discuss in Detail about JSP.

JSP (Java Server Pages) is a technology that helps software developers create dynamically generated web pages It is based on HTML,XML, or other web document types. JSP was released in 1999 by Sun Microsystems. It is similar to PHP, but it uses the Java programming language to perform the background functionality.

To run JSP, a compatible web server with a servlet container is required, such as Apache Tomcat or Jetty.

The architecture of JSP may be viewed as a high-level abstraction of Servlets. JSPs are translated into servlets at runtime and the output is displayed to the user. These JSP servlet are cached and re-used until changes to the original JSP file are done. The architecture of JSP can be viewed as:

The main benefit of JSP is that it allows Java code and certain pre-defined actions to be interleaved with web content. And the resulting page being compiled and executed on the server to deliver a document. These compiled pages, use Java Byte Code for the final execution rather than a native software format. Like other Java programs, Java Server Pages must be executed within a JVM (Java virtual machine) which integrates with the server’s host operating system (Tomcat or Jetty) to provide a neutral environment.

Syntax of JSP
Java Server Pages use different types of tags for scripting functions. The most basic one is known as Scriptlet tag which encloses a JSP scriptlet or a Java code inside it. Code insidescriptlet tag is run when the user requests the page. Other common JSP tags are:

• Expression Tag
A JSP expression tag is used to insert Java values directly into the page output. The Java expression is converted to a string, and inserted in the page.

• Scriptlet Tag
If you want to perform some complex operation than a simple insert, JSP Scriptlet Tag is used. Scriplet Tag have the following form:

• Declarative Tag
These are inserted into the body of the servlet class and outside of any existing methods in the Java Servlet Pages.
This tag is used to globally define the variables.

Lets take a look at an example of JSP:-

The output displayed in the user’s web browser would be:

Hello

The JSP article presented here covers the most useful JSP programming tag constructs. The article is focused on being simple and practical, therefore not all details have been covered.When you are comfortable with JSPs and ready to go in more details, you may find some topics from the Oracle’s JSP page.

PrintGoogle GmailFacebookBookmark/Favorites