Solved

Link to posts criticizing JSP Taglibs as scriptlets in disguise

Posted on 2004-08-15
9
333 Views
Last Modified: 2013-11-24
I am looking for an article or post I am sure I saw (or maybe it is in a book and someone can recall which one) where some taglibs, such as the JSTL "c" namespace tags, are criticized as scriptlets in disguise, because they still just offer the same control functionality as the java language rather than really representing some presentation semantic.

I am currently working in a small company and a new team-member is strongly suggesting we all move away from scriptlets to tags.  While to some degree this notion has merit, we do not really have a situation in which there are non-programmers doing JSPs, nor do we have significant trouble maintaining a clear separation of logic from presentation in most cases.  Additionally, some members of the team have claimed to experience performance issues significant enough to abandon the use of tag libraries in the past.

We haven't the time to do extensive prooof-of-concept work, nor are we certain we could cover enough scenarios, to establish the pros/cons adequately enough to dissent or acquiesce on our own.

I'd like links to relevant articles evaluating the design and performance characteristics of taglibs, NOT to tutorials on their creation or use (that knowledge we have or know already).

Of course, experts opinions and experience with tags vs. scriptlets is also appreciated, but please...something beyond the repeating of the cliches about separation of business logic and presentation, etc.  I want real-world anectdotes and informed opinions based on experience, not quotes from the current mass media expounding the virtues of the latest technologies and design fads (patterns).

I'll split points among the most helpful posts.  THANKS!!!!

0
Comment
Question by:sbockelman
  • 3
  • 2
  • 2
  • +1
9 Comments
 

Expert Comment

by:Drop_of_Rain
ID: 11806897
0
 
LVL 92

Expert Comment

by:objects
ID: 11807240
Is performance the only objection to using tag libraries?
0
 
LVL 3

Author Comment

by:sbockelman
ID: 11815595
objects,

There are numerous points being rasied as concerns the use of tag libraries vs. other technologies, such as XSLT, or just plain ol' java logic.

Performance is one particular concern coming from one particular team member who claims to have had to rip tag libs out of a page in order to get performance down from 60-70 seconds to 2-3 seconds.  This is anecdotal and unsubstantiated, of course, but... he is a senior member of the staff, so... he needs to be met with some evidence of compelling evidence to the contrary.

More so, I find that the need to learn (and read) yet-another-syntax is only worthwhile if it truly offers something we cannot already achieve using what we already know.  Not that anyone on staff finds taglibs particular complex, mind you...but it is just sort of a cognitive annoyance to have to keep getting used to new ways of saying the same things.

Finally, I am sure I saw a very eloquent post, or article, or maybe an excerpt from a book, that criticized some taglibs in particular as being naive in that they simply replaced java logic constructs with tags (e.g., <c:if> is still just an iff condition) and advocated a more business-specific or application-specific level of functionality.  I'd like to find that article or book again.

For the first poster, Drop of Rain, I appreciate your participation, but I specifically asked for links that talk about whether to use taglibs or not... NOT tutorials or general info links.  
Thanks anyway.  Perhaps you will run accross such discussions and think back and post them here.  

Anyway...I'll keep,looking and hope to hear some helpful stories soon.

The major proponent is arguing that taglibs "enforce" separation of logic and presentation.  With tags such as forEach, if, etc.,  I just don't see it. These appear to me to just be new and more awkward ways of performing the same logic.  That is, these are just scriptlets in disguise.


0
 
LVL 92

Expert Comment

by:objects
ID: 11815947
If your team is all Java developers then the advantages of using tags are lessened, but it still provides a standard means for reuse of code in your jsps. They can also improve the readability of your jsp.

I'd suspect the poor experience performed was due to use of poorly written tags, which can happen whether or not you use tags. You'd need a concrete example to determine the exact cause.

Sorry I haven't seen the article you refer to.
 
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 3

Author Comment

by:sbockelman
ID: 11934129
I don't think I can really award any points here, sorry...

I am really looking for a particular level of critique (or links to such) as pertains the use of Tag Libraries as a "best practice" for application design.

Drop of Rain posted only easily found tutorials on using Tag Libraries, which is not what I asked.

objects, though I appreciate and respect your comments (and probably have to agree that the performance problems are situational or anecdotal at best), they didn't really help me argue with my colleagues, who want to establish a "one way to do things" sort of mentality (with which I fundamentally disagree, of course).

I personally find that the use of Tag Libraries can hide some logic, especially if you aren't used to reading them or if your editor doesn't cause them to stand-out (mine doesn't, but it highlights scriptlet code).  So, to me, readability is a concern.  Performance MAY be degraded just by the nature of the mechanics of the tags, each is a separate object that must be instatiated, populated, then execute methods...inline code is usually more efficient.  Some JSP compilers may inline tags??  I haven't seen any that do, however.  And tags that use reflection to get bean properties may incur additional overhead, as well.

That said, I have actually created custom tags for some projects and enjoyed their use, but these were to do things like formatting dates, numbers, and special Strings, like phone numbers, social security numbers, etc.  I could even see how specific-to-the-solution-domain tags might be an excellent tool, but...

What our guys are doing is, to me, just scriptlets in disguise:  <c:for-each />, <c:if />, etc....
And I just don't see the benefit over <% if( ) { %>content<% } %>

I was sure I had read an article supporting my position, but I cannot find it again.  I was hoping one of you guys would have seen it, or maybe even written it, who knows?  Oh well...

back to coding...

0
 
LVL 3

Author Comment

by:sbockelman
ID: 11938321
I finally found an article with one section similar to the kind of information I have been seeking; see section 3 of the article at: http://www.informit.com/articles/article.asp?p=30334

Anyone know of more like this?
0
 
LVL 14

Accepted Solution

by:
sudhakar_koundinya earned 125 total points
ID: 11939797
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 11939803
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
solarwind tftp server 2 44
why cannot we forward request once the response is committed 2 33
Windows 10 and JDK 7 7u85 4 31
Way to decrease size of apk file 9 42
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
The viewer will learn how to implement Singleton Design Pattern in Java.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now