This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Hello all, I'm a totally confused to decide which one, Javabeans or Custom tags, is the best to use within a JSP page and in what circumstances? pl. help ...
Best regards,<br /> <br />vanchin
Winston Smith
Ranch Hand
Joined: Jun 06, 2003
Posts: 136
posted
0
I'm relatively new to JSP, and I've been using Beans to support all the business logic of my applications. However, I'm starting to look at custom tags because the code seems alot cleaner -- it takes virtually all those annoying scriplets out of your JSP, and moves them to a class where they should be. I'm not sure how these two technologies compare as far as efficiency, but it does seem that custom tags lend themselves to cleaner, more modular code. Hopefully there will be some more posts to discuss this. WS Oh yeah, I've been reading some interesting articles on JSTL (beginner tutorials, etc.) at IBM developerWorks: http://www-106.ibm.com/developerworks/java/library/j-taglib/ [ April 01, 2004: Message edited by: Winston Smith ]
for (int i = today; i < endOfTime; i++) { code(); }
It's certainly not an either-or scenario. In a well-architected web app, the JSP pages will serve the function of the View and will perform little to no processing on their own. In this scenario, beans are a great way to carry data from the controller (usually a servlet) to the view. Custom actions (formerly known as custom tags) are great to create re-usable on-page components. I use both liberally in my web apps.