Example & Tutorial understanding programming in easy ways.

What is the difference between custom JSP tags and JavaBeans?

 In the context of a JSP page, both accomplish similar goals but the differences are:

                custom tags                 javabeans
Can manipulate JSP content Can't manipulate JSP content
Custom tags can simplify the complex operations much better than the bean can. But require a bit more work to set up. Easier to set up
Used only in JSPs in a relatively self-contained manner. Can be used in both Servlets and JSPs. You can define a bean in one Servlet and use them in another Servlet or a JSP page.

JavaBeans declaration and usage example:

<jsp:useBean id="identifier" class="packageName.className"/>

<jsp:setProperty name="identifier" property="classField" value="someValue" />

<jsp:getProperty name="identifier" property="classField" />

<%=identifier.getclassField() %>

Read More →
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!