By convention, a JavaBeans component provides the get and set methods for reading and modifying its private properties. You can get the property in JSP using the syntax shown below:
<jsp:getProperty name = "beanId" property = "sample" />
This is equivalent to
<%= beanId.getSample() %>
You can set the property in JSP using the following syntax:
<jsp:setProperty name = "beanId" property = "sample" value = "test1" />
This is equivalent to
<% beanId.setSample( "test1" ); %>