JSP Standard Actions: set property : Beans « JSP « Java






JSP Standard Actions: set property


/*
Beginning JavaServer Pages
Vivek Chopra, Jon Eaves, Rupert Jones, Sing Li, John T. Bell
ISBN: 0-7645-7485-X

*/


<html>
<head>
</head>
<body>
  <jsp:useBean id="myProduct" class="com.wrox.begjsp.ch03.Product">
    <jsp:setProperty name="myProduct" property="sku" value="12345"/>
    <jsp:setProperty name="myProduct" property="name" value="DSL Modem"/>
  </jsp:useBean>
<table border="1">
 <tr>
    <td>Sku:</td><td><%= myProduct.getSku() %></td>
 </tr>
<tr>
    <td>Name:</td><td>${myProduct.name}</td>
 </tr>
</table>

  <jsp:useBean id="myMap"  class="java.util.HashMap" />
  <jsp:useBean id="myMap2"  class="java.util.HashMap"  type="java.util.Map"/>


 </body>
</html>

           
       








BeginningJavaServerPages-ch08-1.zip( 293 k)

Related examples in the same category

1.Calling a Private Method
2.Jsp Form And Bean
3.Get Set Properties JSTL
4.Getting a Property Value
5.Using a Constructor
6.Using Bean Counter JSP
7.Using a Java Bean Jsp
8.Using Package Jsp
9.Using UseBean in Jsp
10.Set Property Value
11.Jsp Using Bean Scope Session
12.Bean property display
13.Beans with scriptlet
14.EL and Complex JavaBeans
15.JSP with Java bean
16.JSP form and Java beans
17.JSP email valid check
18.JSP and Java beans 3
19.JSP and Java beans (JavaBeans) 1JSP and Java beans (JavaBeans) 1
20.JSP and Java beans (JavaBeans) 2JSP and Java beans (JavaBeans) 2