Thursday, February 7, 2008

Java Standard Tag Library (JSTL) Advantages

Java Standard Tag Library (JSTL) Advantages

JSTL, which stands for Java Server Pages Standard Tag Library, is a collection of custom JSP tag libraries that provide common Web development functionality. It was originally developed as the open source Apache Jakarta Taglib project but is now managed by the Java Community Process (JCP) under JSR-52 and Standard by Sun. JSTL's key goal was to remove the need for J2EE Web developers having to build their own proprietary tag libraries for common Web development processes.

The common Web development areas which JSTL covers include:

  • Conditionals
  • Iterations
  • Text formatting
  • Database access (SQL)
  • XML processing
  • Internationalization
  • Accessing URL resources

Problems With Scriptlet
Java Server Pages Provide a way to develop presentation layer by merging static HTML code and dynamic Java Code using script. It is best as compared servlet but programmers or web developers who work on presentation layer mix java code.

  1. Scriptlet code is not reusable--Scriptlet code appears in exactly one place: the JSP page that defines it.
  2. Scriptlets encourage copy/paste coding--Because scriptlet code appears in only one place, it is often copied to a new context.
  3. Custom tags centralize code in one place. When a tag handler class changes, the tag's behavior changes everywhere it is used.
  4. Scriptlets mix logic with presentation-. Scriptlets can easily confuse the intent of a JSP page by expressing program logic within the presentation.
  5. Scriptlets break developer role separation.
  6. Scriptlets make JSP pages difficult to read and to maintain
  7. Scriptlet compile errors can be difficult to interpret
  8. Scriptlet code is difficult to test

<% if

((User)session.getAttribute("user")).getName().equals("test") {
%>
<% }
%>



<>test =" $ { user.name = = 'test'
} " >

.......
<
/ c : i f >




JSP Standard Taglib
Library Advantages

1.
Standard Tag
Once standardized, JSTL will provide a rich layer of portable
functionality to JSP pages.
It is easy for developer to
understand other code easily. Before Jstl every made his propriety tag
which are different for
every one now its standard and easy
to understand for all. It also is mature and tested.

2.
Make Code Neat and Clean It makes the code neat and clean usually
scriplet confuse the developer due to mixing of java and html

code. it
makes clean the code

3
.Automatic JavaBeans Introspection Support Here is
little advantage to JSTL over JSP scriptlets. But if you consider that
JSTL's
expression language handles JavaBean introspection
automatically.

4.
Easier
for Humans to Read JTSL is based on XML, which is very similar to HTML.
Rather than spending a great deal of time learning
where to
put semicolons and how to construct code blocks, HTML programmers can
fall right into a programming language that is similar to
HTML


5.Easier for Computers
to Read It is also much easier for computers to read. Tools such as
FrontPage and Dream weaver
are generating more and more HTML
code. Although HTML generation tools do a great job of formatting HTML
code, they often
run into problems when this HTML code is
intermixed with JSP scriptlet code. Because JSTL is always expressed in
XML-compliant tags,
it will be easier for HTML generation
tools to parse the JSTL code that is contained within the document




The above
are basic benefits of jstl
.JSTL introduce new way of
development and have lots of benefits in bits and
bytes level
I discussed only bytes level benefits it not easy to cover bites level
in this discussion but it is enough
for
understanding.

9 comments:

jhansi joe said...

Excellent post!!! Your article helped to under the future of java development. Being an open source platform, java is integrated in most of the software development industries to create rich featured applications.Java Course in Chennai | Best JAVA Training in Chennai|JAVA Training in Chennai

prathap kumar said...

Interesting Article

Java Training in CHennai | Core Java Training in Chennai


Java Online Training Institutes in Chennai | Java EE Training Institutes in Chennai

Andrew Son said...

This content creates a new hope and inspiration with in me. Thanks for sharing article like this. The way you have stated everything above is quite awesome. Keep blogging like this. Thanks,
Best JAVA Training in Chennai | JAVA Training |Java Training in chennai

Arjun Rishi said...

Great article. This is very useful. Thanks for sharing.

html training in chennai

تاریخ اسلام said...

https://www.quester.pk/question/does-telenor-have-3g-coverage-in-daharki/
https://www.quester.pk/question/does-telenor-have-3g-coverage-in-daggar/
https://www.quester.pk/question/does-telenor-have-3g-coverage-in-dadu/
https://www.quester.pk/question/does-telenor-have-3g-coverage-in-chunian/
https://www.quester.pk/question/does-telenor-have-3g-coverage-in-chowk-sarwar-shaheed/

Evelin Harriet said...

Great information. I have got some important suggestions from it. I'm working in ERP Software Company in Chennai. | ERP Providers in Chennai.

venkatweetz said...

Very Nice Blog I like the way you explained these things. I’ve been looking for ways to improve my website and overall rankings.I hope your future article will help me further.Take SEO Training in Chennai to mould yourself.

Mohana M said...

Hi, I am a big follower of your blog. Really very informative post you shared here. Keep sharing this type of informative blog. Waiting for your next update. If anyone wants to become a Java professional learn Java Training in Bangalore. Nowadays Java has tons of job opportunities for all professionals.

vignesjoseph said...

Everyone wants to get a unique place in the IT industry’s for that you need to upgrade your skills, your blog helps me improvise my skill set to get a good career, keep sharing your thoughts with us.
Software Testing Training in Chennai