Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tag Libraries and Scriptlets

 
Joshua Smith
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All-

I have considered taking the SCWCD, but was discouraged from doing so by a number of people. They thought that there were much more important things to study as far as server-side technologies. They specifically criticized the fact that it includes tag libraries and scriptlets as major topics and viewed them more as stepping stones to the current state of Java EE, but things that were not major areas that a developer would/should spend his time nowadays.

Could anyone speak to this criticism? Would the information gained by studying SCWCD Study Companion be useful in day to day work?

Thanks,
Joshua Smith
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anyone speak to this criticism?

I think that people should learn more about using the Expression Language, JSTL and custom tags. That way, they will learn to create some decent looking JSP, instead of some unreadable, full of code junk

Do not underestimate the value of this exam. It will bring you a lot, concerning web applications development. You were told that there were much more important things to study ? I tell you that this is the basic knowledge you have to get before going further
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personally, I believe the J2EE (Java EE) Web tier is the most important of all the J2EE components. Of late there has been much debate about whether "J2EE will die", whereas in fact the entire discussions have really centred around whether "EJBs will die". Many people seem to think J2EE is EJB (and vice-versa) which is a highly erroneous belief. When I tackled a couple of people spreading the belief that Java is dead, they found it difficult to respond to the fact that the Java Web container is the most reliable and sophisticated Web server of its kind - you've got the power of a whole OO programming language behind you (unlike in PHP for instance). On the contrary, their opinion is that EJBs are just an over-bloated API, where many services using EJBs could easily be refactored into simple JavaBeans/POJOs with a bit of thought.

I can't see how you could criticise both tag libraries and scriptlets: if you're going to have dynamic JSPs, you've basically got to have one or the other. You can either create pages full of Java code using scriptlets, or go for the newer (and perhaps better) scriptless pages by using EL and tag libraries. Personally, I do the latter on a daily basis. Using EL and tag libraries not only creates 'cleaner' pages, but it helps you review your design decisions and place programmic code in servlets where it belongs. If you really do need some processing, using a custom tag will give you flexibility to use that tag over-and-over again in many different pages. Using the same scriptlet code repeatedly is likely to require multiple copy-and-pastes and reduce the maintainability of your application.

Even if you don't want to create tags yourself, if you plan to make use of anyone else's tags (and there are many useful ones out there, such as XML and SQL formatters in the JSTL libraries), you obviously need to know how they work...

All the basics and more advanced topics are covered in my book - everything you need to know about core Web development which would give you excellent grounding for any Java EE Web project you wanted to go into.
[ August 01, 2006: Message edited by: Charles Lyons ]
 
Joshua Smith
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you both for your comments.

The false equating of Java EE (aka J2EE) with EJBs has been, and continues to be, a serious problem. I would be willing to bet that the majority of Java EE apps don't use EJBs at all. I'd love to see some statistics on that.

Also, I've found that a lot of those criticizing EJBs have not seen EJB 3.0. It's a world of difference!

In any case, you've caused me to take a second look at SCWCD.

Thanks,
Joshua Smith
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic