Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
JSP Tags vs. JavaBeans
What is difference between custom JSP tags and JavaBeans?
✍: FYICENTER.com
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, 7486👍, 0💬
Popular Posts:
What will be printed as the result of the operation below: main() { char s1[]="Cisco"; char s2[]="sy...
Do You Know the Book "JUnit in Action"? You should know this book. It received some good reviews. Ti...
How To Set Up Breakpoints in Debug Mode? - Oracle DBA FAQ - Introduction to Oracle SQL Developer To ...
How To Set Up Breakpoints in Debug Mode? - Oracle DBA FAQ - Introduction to Oracle SQL Developer To ...
What is the output of printf("%d")? 1. When we write printf("%d",x); this means compiler will print ...