tags:

views:

604

answers:

3

Difference between Custom Tag and Java Bean?

+2  A: 

A custom JSP tag has to be interpreted and run inside a JSP; a Java Bean does not.

A custom JSP tag has to extend the javax.servlet.jsp.tagext.Tag interface; a Java Bean does not.

A custom JSP tag might use other Java Beans to do its work, but the reverse is not true.

duffymo
+1  A: 

Custom tags have access of implicit objects like request, response, session, etc. JavaBeans are normal java classes and don't know anything about JSP.

Javabeans are normally used to maintain the data and custom tags for functionality or implementing a logic on jsp page.

Bhushan
+1  A: 

Custom tags have access of all implicit objects.JavaBeans are java classes but all java class are not java beans. The major one is - Custom tag can use java beans to commuicate with each other.