java left logo
java middle logo
java right logo

Home arrow Java Tutorials arrow Introduction to JSTL using NetBeans
Main Menu
Java Tutorials
Book Reviews
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Java Network
Java Forums
Java Blog

Most Visited Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews
Top Rated Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews

Registered Users: 4116
Java SE Tips: 614
Java ME Tips: 202
Java EE Tips: 183
Other API Tips: 779
Java Applications: 298
Java Libraries: 209
Java Games: 16
Book Reviews:
Introduction to JSTL using NetBeans E-mail
User Rating: / 164

2. Why use JSTL?

Advantage of JSTL

  1. Scriptlets (Java codes within JSP) are complex and are extremely hard to be maintained. Unlike scriptlets, JSTL makes our JSP readable and maintainable.
  2. HTML programmer may find it hard to modify the JSP with the scriptlets as he or she may not have the Java programming knowledge. However, if we are using JSTL to replace our scriptlets, HTML programmer can easily understand on whatís going on in the JSP as JSTL is in the form of XML tags similar to the normal HTML tags.
  3. JSTL has been standardized and is reusable tags.
  4. The name of each tag in JSTL is self-explanatory and is easy to understand.
  5. JSTL requires less code compared to scriptlets.

Shortcomings of JSTL

  1. Scriptlets provide you with greater flexibility. As scriptlets is simply a Java codes, you can do anything that you want as you normally do with a Java programming. On the other hand, JSTL is a very specific and each tag has its own purposes.


JSTL Tutorial

Until now, you should have known the basic of the JSTL theoretically. Letís move on to real JSTL practice. Start your NetBeans.

Create New Project

Letís first us create new project for this tutorial. After Netbeans has already been started, choose File and New ProjectÖ



















A wizard dialog will show up, choose Web on the left panel and choose Web Application on the right panel. Then click Next to continue.


In the step 2, we are required to fill in our projectís information details. Use self-explanatory name for the project name. Ok, letís call it JstlDemo. We can keep the rest as default. Then click Finish.




At this point, our web application is ready. File called index.jsp will be automatically created for us.

Preparing the Library

JSTL requires 2 jars; jstl.jar and standard.jar. These two files are not included in our default library. We need to add these libraries to our project.

On the left projects tab panel, we can see a folder named Libraries. Right click on this folder and Add LibraryÖ





After this one, we will see list of available libraries. Choose JSTL 1.1 and Add Library.

If you carefully look at the index.jsp, it contains the JSTL tag but it is commented.


<%@taglib uri="" prefix="c"%>


You may try to uncomment it to test whether you have correctly imported the JSTL libraries.

< Prev   Next >

Page 1 of 0 ( 0 comments )

You can share your information about this topic using the form below!

Please do not post your questions with this form! Thanks.

Name (required)

E-Mail (required)

Your email will not be displayed on the site - only to our administrator

Comment Enable HTML code : Yes No

java bottom left
java bottom middle
java bottom right
RSS 0.91 FeedRSS 1.0 FeedRSS 2.0 FeedATOM FeedOPML Feed

Home - About Us - Privacy Policy
Copyright 2005 - 2008
Java is a trademark of Sun Microsystems, Inc.