jsp Creating custom tag libraries using JSP 2.0(Without java classes)

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

In order to use custom tags in JSP,we used to have TLD files,along with a Java class to define the custom tags but post JSP 2.0 specs,the same can be achieved,without the need for any Source code files,making it easy to maintain and it can also be created by someone with basic knowledge of JSP tags without need for java code.

Remarks

Usually for adding static content to a HTML page,we use either

link rel="import" tag (in HTML5) or jQuery .load("")

to include any external content.In case of any dynamic content,using JSP,we use

jsp:include

to include such content.But for cases,when we want to add custom content,which can interact with the existing content,we use custom JSP tags.They allow us to generate custom content,based on params from the caller and also pass back values processed in the custom tag back to the caller.

References:

  1. Custom tags in JSP pages
  2. Difference between JSP tags and includes
  3. Tag variable scope


Got any jsp Question?