This week's book giveaways are in the Cloud/Virtualization and Go forums.
We're giving away four copies each of Cloud Native Transformation: Practical Patterns for Innovation and The Go Workshop and have the authors on-line!
See this thread and this one for details.
Win a copy of Cloud Native Transformation: Practical Patterns for InnovationE this week in the Cloud/Virtualization forum
or The Go Workshop in the Go forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

Integration with JSTL and Struts

 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys..
Now that I've seen Shawn B. around I'd like to ask a question regarding these two technologies (or frameworks).
I've read somewhere that the integration between JSTL and Struts is not as good as a developer can expect. Unfortunately, I do not the reasons why people say that.
I've used the mailer tag lib and I think it is excellent and easy to use. Now I'm thinking to start my new project with the Struts framework and would like to know some opinions of you guys regarding this.
Is it easy to integrate?
thank you
 
Author
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Andres Gonzalez:
Hi guys..
Now that I've seen Shawn B. around I'd like to ask a question regarding these two technologies (or frameworks).


Hi Andres!


I've read somewhere that the integration between JSTL and Struts is not as good as a developer can expect. Unfortunately, I do not the reasons why people say that.
I've used the mailer tag lib and I think it is excellent and easy to use. Now I'm thinking to start my new project with the Struts framework and would like to know some opinions of you guys regarding this.


Note that it is very important to avoid confusing JSTL with Jakarta Taglibs. JSTL is a standard from the Java Community Process. Jakarta Taglibs is an open-source project that contains many custom tag libraries. The confusion perhaps comes from the fact that Jakarta Taglibs offers an implementation of JSTL called the "Standard Taglib," as one of its many taglibs. But other vendors, like any JCP standard (such as the Servlet API or JSP itself), will offer implementations as well.
As another difference, Jakarta Taglibs has been around for years, while JSTL is new -- it was just released this June/July.
Just to be clear, the Mailer Taglib from Jakarta Taglibs is not part of JSTL.
To answer your question, I suspect that the things you've heard about integration with struts apply to Jakarta Taglibs and not really to JSTL. Jakarta Taglibs was never aggressively intended to integrate with Struts; overall, perhaps there should be more integration among Jakarta projects, but it's still common for two projects not to work well together. Jakarta Taglibs does provide some offerings that don't make sense to use with Struts.
JSTL, by contrast, should work with Struts perfectly. The only issue is when Struts will begin to adopt the expression language and, perhaps a little further away, the JSTL tags for flow control, i18n, and so on. But no issues are expected; Craig and I have discussed this in the past, and I don't suspect any technical problems. In fact, the standard API that JSP 2.0 adds for accessing the JSTL expression language was designed to make it easy for frameworks like Struts (and, also, JavaServer Faces) to use the JSTL expression language.
Please let me know if you've got any further questions. I think it's important to make sure that people know that JSTL isn't Jakarta Taglibs.
[ August 20, 2002: Message edited by: Shawn Bayern ]
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shawn,
My question is twofold. 1) Where can I go to learn more about JSTL? 2) How does using JSTL compare to using Jakarta's Taglibs, or anyone else's taglibs for that matter, in regards to separating presentation from business logic and data?
Thanks.
 
Shawn Bayern
Author
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Eric Peterson:
Shawn,
My question is twofold. 1) Where can I go to learn more about JSTL?


Hi Eric,
http://java.sun.com/products/jstl is Sun's official page on JSTL.
http://www.jstlbook.com is my book's site; my book serves as an introduction to every feature of JSTL. The index, contents, and a few sample chapters are available from http://www.manning.com/bayern

2) How does using JSTL compare to using Jakarta's Taglibs, or anyone else's taglibs for that matter, in regards to separating presentation from business logic and data?


Most people are likely to prefer JSTL for two reasons:
- It was designed carefully, with industry consensus, substantial debate and feedback. Its design took into account MVC as well as the fundamental separation of business logic from presentation. (Still, it doesn't require that you use an MVC approach.)
- It is a standard, meaning that you learn it once and rely on its presence across multiple containers. Books, articles, and other high-quality educational materials can be made available, making your pages more likely to be easily maintained by someone else (and your skills more likely reused across multiple projects). Also, containers can recognize the standard JSTL tags and optimize their implementation, making them potentially faster than other nonstandard tags.
Hope that helps,
Thanks.
[ August 20, 2002: Message edited by: Shawn Bayern ]
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Eric Peterson:
Shawn,
2) How does using JSTL compare to using Jakarta's Taglibs, or anyone else's taglibs for that matter, in regards to separating presentation from business logic and data?
Thanks.


Eric,
Separating logic and data from presentation is a bigger issue than just using a tag library. For most non-trivial applications, you will want to utilize a Web application framework such as Struts to help in making a clean separation.
There are a multitude of such frameworks (see The Wafer Project), and many of them do not even use JSP for the view layer. If you are writing a non-trivial application, do some research and settle on a framework first. If it allows JSP for the view layer, then see what tag libraries it provides, recommends, or allows. At that point you are ready to consider supplementing your toolkit with JSTL and possibly other tag libraries.
In my opinion, the momentum tag libraries are gaining is one of the big advantages of utilizing JSP for your view layer. There are already many useful tag libraries out there (such as JSTL and Jakarta Taglibs) which I incorporate into projects, and I'm quite sure the number of available tag libraries is going to mushroom in the coming months/years. This is the main reason I am reluctant to stray too far from JSP.
 
Can you really tell me that we aren't dealing with suspicious baked goods? And then there is this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!