• Post Reply Bookmark Topic Watch Topic
  • New Topic

How useful are tag libraries?

 
Paul Ramsden
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a bit surprised to read the posts which say how many tag-lib questions there are in the exam.
So far (2yrs J2EE), I've had no need to resort to tag-libs.
How useful are they really?
Paul
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IMHO Extremely. They are particularly useful if the design of the page is handled by someone who is skilled in HTML but, not Java. Even when this is not the case, it moves the Java Code back into a class that can be Unit tested to ensure reliability of your code.
 
Joel Carklin
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have found them very useful for iteration, for dealing with date time entry/display...
I guess you could do all thses things without tag libraries but the web page would be a nightmare if you just wanted to work on the design...
 
Rick Salsa
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use them all the time!! They're fantastic. We use them at work for every java project we do. Where I work, there are developers and designers. The designers do all the html coding as well. They use the libraries that our framework (WebWork) provides. This way, we have the nothing but tags in our view pages (jsp's), no scriptlets at all. All the work is done use plain old java classes, and the tag libraries pull the results and display them.
This also helps us in getting our projects done quicker. The developers can code and the designers can design all at the same time.
Take a look at WebWork, it's fantastic, and the taglib's that come with it are great!!
Just my 2cents ,
/rick
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also agree that tags are great.
Imagine that you have lots of pieces of common, recurring functionality in your JSP pages such as iteration, conditional logic, looking up specific information, all of which are written as scriptlets. Then imagine that you have to change these across your entire web application!
Tags are a great way to wrap up this type of stuff while providing a nice level of abstraction onto the functionality that they provide. In summary, a great way to increase the readability of the page while introducing maintainable, reusable components.
...just some more cents to add to the thread.
Simon
 
Ricardo Cortes
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the JSP Standard Tag Library which recently had it's final release in the Java Community Process...
http://www.jcp.org/jsr/detail/52.jsp
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!