My Sites


Saturday, May 16, 2015

JavaBean Requirements

  • It provides a default, no-argument constructor.
  • It should be serializable and implement the Serializable interface.
  • It may have a number of properties which can be read or written.
  • It may have a number of "getter" and "setter" methods for the properties.
Accessing JavaBean from jsp
<jsp:useBean id="students" 
                    class="com.amila.StudentsBean"> 
   <jsp:setProperty name="students" property="firstName" value="Zara"/>
   <jsp:setProperty name="students" property="lastName"  value="Ali"/>
   <jsp:setProperty name="students" property="age" value="10"/>
</jsp:useBean>

No comments:

Post a Comment