File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes custom tag and beans Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply Bookmark "custom tag and beans" Watch "custom tag and beans" New topic
Author

custom tag and beans

veeramani velayutham
Greenhorn

Joined: Dec 10, 2004
Posts: 11
what is the difference in using customs tag and beans.

which one is the best to use. can anyone give explanation.

regards
veeramani.v
Paul Bourdeaux
Ranch Hand

Joined: May 24, 2004
Posts: 783
Custom Tags are more advanced and flexible than standard jsp tags, such as <jsp:useBean ../> Custom tag libraries make it possible to create business logic that is almost completely hidden from the presentation layer.

Beans, however, can also make for a cleaner, less cluttered JSP page. For example, a bean's properties can be automatically set by parameter values from a client request. Beans also have scope, which means they can be used per request, between pages, per session, or even throughout an entire application.

As far as which is better... well that depends on what you would like to do. Both beans and custom tags have their place in jsp.


“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56521
    
  14

Both beans and custom tags have their place in jsp.


Indeed. In fact, the question doesn't make much sense to me. It's like asking "what's better in a Java class, variables or statements?"

Beans are used to hold information for a JSP page, usually as scoped variables. Custom tags, and standard tags such as the JSTL, are used to operate upon this data.

It isn't an either-or situation.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: custom tag and beans
 
Similar Threads
Java beans Versus Tag libs
per-session instance of servlet?
WA #1.....word association
Getting Exception creating bean of class JSP Exception
Display fro Java Class