• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unnecessary Complications in JSTL taglib declaration  RSS feed

 
Sangel Kapoor
Ranch Hand
Posts: 162
1
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone

I started learning JSTL (Java Standard Tag Library) and i got to know that i need to mention this directive in JSP page



in order to use JSTL tags.

I am not able to understand what does this URI exists at all ?? I feel it making things complex and meaningless or else i am missing something hidden and secret.

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One directive is complex?

Like any other tag library, the JSTL needs to be declared with such a directive in order to load the library and associate it with the prefix.
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a taglib directive, the URI is not a location, it's just a name that happens to be formatted like a URL. (refer to HFJS page 484). You can actually put anything there as long as the name in the directive matches the <uri> element in the TLD file. I've even seen custom tag libraries that use the file path as the uri, but that's a Bad Idea as it ties usage of the file to the file structure and therefore can break portability.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!