JSP Tags vs. JavaBeans
What is difference between custom JSP tags and JavaBeans?
Custom JSP tag is a tag you defined. You define how a tag, its attributes and its body are interpreted, and then group your tags into collections called tag libraries that can be used in any number of JSP files. To use custom JSP tags, you need to define three separate components:
When the first two components are done, you can use the tag by using taglib directive: <%@ taglib uri="xxx.tld" prefix="..." %>
Then you are ready to use the tags you defined. Let's say the tag prefix is test: <test:tag1>MyJSPTag</test:tag1> or <test:tag1 />
JavaBeans are Java utility classes you defined. Beans have a standard format for Java classes. You use tags: <jsp:useBean id="identifier" class="packageName.className"/>
To set a new value to a bean property: <jsp:setProperty name="identifier" property="classField" value="someValue" />
To get the existing value of bean property: <jsp:getProperty name="identifier" property="classField" />
Custom tags and beans accomplish the same goals -- encapsulating complex behavior into simple and accessible forms. There are several differences:
2007-04-03, 7156👍, 0💬
What are the core functionalities in XML .NET framework? Can you explain in detail those functionali...
How do we host a WCF service in IIS? Note: - The best to know how to host a WCF in IIS is by doing a...
How To Delete a User Account? - Oracle DBA FAQ - Managing Oracle User Accounts, Schema and Privilege...
Describe different elements in Static Chart diagrams ? Package: - It logically groups element of a U...
What Are the Parameter Modes Supported by PL/SQL? - Oracle DBA FAQ - Creating Your Own PL/SQL Proced...