• Menu
  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

JavaBeat

Java Tutorial Blog

  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)
  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)

New Features in JSP 2.0

September 19, 2008 //  by Krishna Srinivasan//  Leave a Comment

New Features in JSP 2.0

JSP 2.0 is released with new promises. JSP 2.0 is an upgrade to JSP 1.2 with several new and interesting features. These features makes the life of web application developers and designers easier.

also read:

  • Java EE Tutorials
  • Servlets Interview Questions
  • New Features in Servlets 3.0
  • Asynchronous Servlets in Servlets 3

The JavaServer Pages 2.0 Specification is fully backwards compatible with version 1.2. JSP 2.0 allows the developer to write script-free code without without declarations, scriptlets and expressions.

JSP 2.0 is released with the objective of making the life of Developers easy. Here is the new features of JSP 2.0:

  • Simple Expression Language (EL)
  • JSP Fragments
  • Simple Tag Handlers
  • Easy tags creation with .tag files
  • Easy Header and Footer template using the prelude and coda includes

With JSP 2.0 web develop has become easily and it also helps easily maintaining dynamic Web pages. Despite the fact the word “Java” appears in JavaServer Pages, with JSP 2.0 the developer can develop pages without learning Java programming language. Learning and using the features of JSP 2.0 is also very easy.

JSP 2.0 Features description is given below:

Simple Expression Language(EL): Expression Language (EL), provides a way to simplify expressions in JSP. EL provides the ability to use run-time expressions outside JSP scripting elements. Scripting elements are those elements which is used to embed Java code inside the JSP file. Mostly it contains the logic of the program.

Scripting elements have three subforms:

  • Declaration: The variables and methods are declared inside declaration.
  • Scriptlets: The business logic of the program is written inside this.
  • Expressions: output will be displayed by the expression.

Expression Language can be enabled in scriptfree JSP pages:

  1. By using a page directive: We can enable EL by using
    <%@ page isScriptingEnabled="true|false" isEnabled="true|false"%>
    
  2. By using an element of the deployment descriptor:
    <jsp-config>
        <jsp-property-group>
            <url-pattern>*.jsp</url-pattern>
            <el-enabled>true</el-enabled>
            <scripting-enabled>true</scripting-enabled>
        </jsp-property-group>
      </jsp-config>
     

JSP Fragments: Jsp fragments is a new feature of JSP 2.0 which allows page author to create custom action fragments that can be invoked. The JSP fragments allows a portion of Jsp code to be encapsulated into a Java object that can be passed around and evaluated zero or more times. Methods for creating a JSP fragment:

  1. Providing the body of a :
    <% attribute name="attributeName" fragment="true">
    
  2. Providing the body of a tag invocation

Simple Tag Handlers:
Easy tags creation with .tag files: With the introduction of JSP 2.0, knowledge of Java is no longer a prerequisite to create a custom tag action. Easy Header and Footer template using the prelude and coda includes. With JSP 2.0 web development has become easy and it also helps in maintaining dynamic web pages easily. To learn JSP 2.0 there is no need to learn java.

Category: Java EETag: JSP 2.0

About Krishna Srinivasan

He is Founder and Chief Editor of JavaBeat. He has more than 8+ years of experience on developing Web applications. He writes about Spring, DOJO, JSF, Hibernate and many other emerging technologies in this blog.

Previous Post: « Benefits of using Web Services
Next Post: h:graphicImage in JSF »

Reader Interactions

Leave a Reply Cancel 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.

Primary Sidebar

Follow Us

  • Facebook
  • Pinterest

FEATURED TUTORIALS

New Features in Spring Boot 1.4

Difference Between @RequestParam and @PathVariable in Spring MVC

What is new in Java 6.0 Collections API?

The Java 6.0 Compiler API

Introductiion to Jakarta Struts

What’s new in Struts 2.0? – Struts 2.0 Framework

JavaBeat

Copyright © by JavaBeat · All rights reserved
Privacy Policy | Contact