aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes JavaBeans Vs Custom Tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "JavaBeans Vs Custom Tags" Watch "JavaBeans Vs Custom Tags" New topic
Author

JavaBeans Vs Custom Tags

Kodo Tan
Ranch Hand

Joined: Aug 14, 2001
Posts: 105
Hi
We all know that we should separate the business logic and presentation logic commonly found in JSP. This can be achieved by JavaBeans or Custom Tags
Anyone knows when should we use JavaBeans or custom tags in JSP and what are the pros/cons and issues for each implementation ?
Thanks in advance
Tahir Mansoori
Greenhorn

Joined: Jul 25, 2001
Posts: 29
Hi
Java Beans are purely used for business logic at middle tier. You develop custom tags for common tasks in dynamic content generation for dispaly and processing.
Shamaila Mahmood
Greenhorn

Joined: Aug 28, 2001
Posts: 16
I think custom tags can replace JavaBean components in all cases.
The primary difference between them are

  1. Beans can not manipulate JSP contents while custom tags can
  2. With the use of custom tags the presentation logic and be separated from business logic completely.
  3. Custom tags can be developed by a Developer and used by a designer while a designer can not use Beans if he does not know Java.

Kodo Tan
Ranch Hand

Joined: Aug 14, 2001
Posts: 105
Hi Shamaila
Yes, I agreed with you that "custom tags can replace JavaBean components in all cases". I may be wrong, but that's what I thought. If this is the case, then do we still need JavaBeans in web component developments ?
Shamaila Mahmood
Greenhorn

Joined: Aug 28, 2001
Posts: 16
Kodo Tan:
As i said earlier that custom tags can replace JavaBean components in all cases but i used Beans in the following cases

  • when I had to deliver some part of my project in a very short period of time
  • I older projects where JavaBeans where used and i had to change some part of it with out changing the jsp version.

  • I think beans are good tool for beginers and useful in rapid application development if do not want to complicate the process.

Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
If I had to name one key difference between JavaBeans and tags, it would have to be that beans don't have access to the environment in which they run.
JavaBeans are still very useful in web development as a way of representing the underlying data/business model, and also for storing state in the HttpSession for example.
Here's a link to a BOF that I presented at JavaOne this year that might be of use... http://www.btinternet.com/~simon_g_brown/conferences/bof-1770.html
Cheers
Simon
faiza haris
Ranch Hand

Joined: Oct 17, 2000
Posts: 173
Hey !
does the link specified work? doesnt work for me???Plz check!
Faiza
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Simon, btinternet.com changed how things are stored. I think you want to show http://www.simongbrown.com/conferences/bof-1770.html


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
Thanks Carl ... I switched my webspace and the btinternet.com links have now disappeared.
faiza haris
Ranch Hand

Joined: Oct 17, 2000
Posts: 173
Thanx Carl!!
faiza
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JavaBeans Vs Custom Tags