• Post Reply Bookmark Topic Watch Topic
  • New Topic

What does JSTL tags turn into ?

 
Yogendra Joshi
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends ,

Its been quite a long time here at the ranch and there has been a lot i have learnt and contributed to my fellow ranchers here.

Now , I have got an book of the Author Shawn Bayern , JSTL in Action by the Manning Publications , I have started learning it and am really loving the way author has explained it. However , While learning i got a question in my mind , may be would be a silly one but still.....

I know that a JSP Turns into a servlet finally , similarly JSTL Tags were written just to shorten the time web authors take while developing the apps.. So does a jstl tag turn into some sort of JSP and then into a servlet ???

Please make this point clear for me. Thanks in Advance.

Yogendra Joshi.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It all depends upon the container. Because the JSTL is a standard, containers like Tomcat don't just use the standard custom action mechansims, but can make customized calls to optimize the operations of the JSTL since it's something that they can know about in advance (which is not true of custom actions that you or I might write).

For Tomact, if you look at the code that is generated, you will see calls to custom methods that the Tomcat code defines just for JSTL support.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be aware that the Bayern book is an older book and only covers JSTL 1.0. For use with Tomcat 5, you should be using JSTL 1.1.
 
Yogendra Joshi
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Bear , Thanks for the immediate reply to my query.

Though the Bayern book is older , Would it not be useful for me to learn JSTL ? If it so , Would you recommend me with a Book which covers JSTL 1.1

Perhaps , I am mostly using Tomcat 5.0.16 as my Web Server. However, the company in which i work for , they use JRUN 4 and jdk1.3 (thats too old , i dont know why they dont upgrade :-))as the server. Is JRUN4 compatible with JSTL1.1 ? Can i use JSTL with JRUN4 as well ? I did not get any documentation on JRUN4 on the MacroMedia website.

Any help again would be appreciated. Also , I have sent you a PM in regards to other feeling i had in my heart for you and the other Ranch Staff , please see it.

Yogendra Joshi.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JSTL spec is not a bad reference for learning JSTL.
 
Stefan Evans
Bartender
Posts: 1822
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JRun4 is a Servlet2.3/JSP1.2 container.
JSTL1.0 works fine in it.
JDK1.3 should be ok, but you will need some of the compatibility libraries that came with JSTL.

Bayern's book "JSTL in Action" is still useful for learning JSTL.
JSTL didn't really change THAT much between versions.
The most significant changes were
- the URI to import the taglib changed.
- JSP2.0 understands EL expressions outside of the JSTL tags, so you can use them whereever you want.
- EL Functions added. Lets you call static functions from EL. Provided several essential functions like "length" (sorely missed in JSTL1.0)

However functionally, all the tags work pretty much the same way they did in the previous version.

I would also recommend you get a copy of the JSTL specification. It is quite readable, is an excellent reference to the tags, and is my "bible" when it comes to JSTL. http://java.sun.com/products/jsp/jstl/reference/api/index.html
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
+1 to Ben and Stefan's posts.

It's important to use JSTL 1.1 in a JSP 2 environment since otherwise the JSP engine and the JSTL will end up "fighting" over whose job it is to interpret the EL, and you end up with weird errors.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As to the question:
So does a jstl tag turn into some sort of JSP and then into a servlet ???


One of the best ways to find this out is to look at the generated servlet source code. Where this source is stored (and if it's even stored) is container specific. In Tomcat, all of the generates servlet source files reside under the {tomcat install}/work directory.
 
Yogendra Joshi
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all of you for clearing my doubts.

Yogendra Joshi.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!