91-9990449935 0120-4256464 |
jsp:setProperty and jsp:getProperty action tagsThe setProperty and getProperty action tags are used for developing web application with Java Bean. In web devlopment, bean class is mostly used because it is a reusable software component that represents data. The jsp:setProperty action tag sets a property value or values in a bean using the setter method. Syntax of jsp:setProperty action tagExample of jsp:setProperty action tag if you have to set all the values of incoming request in the beanExample of jsp:setProperty action tag if you have to set value of the incoming specific propertyExample of jsp:setProperty action tag if you have to set a specific value in the propertyjsp:getProperty action tagThe jsp:getProperty action tag returns the value of the property. Syntax of jsp:getProperty action tagSimple example of jsp:getProperty action tagExample of bean development in JSPIn this example there are 3 pages:
index.htmlprocess.jspUser.javaReusing Bean in Multiple Jsp PagesLet's see the simple example, that prints the data of bean object in two jsp pages. index.jspSame as above. User.javaSame as above. process.jspsecond.jspUsing variable value in setProperty tagIn some case, you may get some value from the database, that is to be set in the bean object, in such case, you need to use expression tag. For example: process.jsp
Next TopicDisplaying Applet In Jsp
|