Filename-addproduct.jsp
<html>
addattribute
<%
session.setAttribute("iPhone","10000"); %>
<%
session.setAttribute("iPoid","1"); %>
<%
session.setAttribute("iPade","2"); %>
<%
out.println(session.getValue("iPhone")); %>
</html>
Filename-input.jsp
<html>
<title>
Input
data.
</title>
<body>
<form
action="http://localhost:8090/wtad/def21/productbean.jsp">
Name:
<input
type="text" name="name"/>
<br>
Description
<input
type="text" name="des"/>
<br>
Price
<input
type="text" name="price"/>
<br>
<input
type="submit"/>
</form>
</body>
</html>
Filename-onlinebean.jsp
<html>
<title>
Onlineshoping
Bean.
</title>
<body>
<jsp:useBean
id="p1" class="def21.Onlineshoping" />
<jsp:setProperty
name="p1" property="name" param="get" />
<%
String
sget=request.getParameter("get");
session.setAttribute(sget,"1000");
%>
Shoping
Data:
${p1.name}
</body>
</html>
Filename-onlineshoping.jsp
<html>
<title>
Online
Shoping
</title>
<body>
<form action="http://localhost:8090/wtad/def21/onlinebean.jsp">
<table
border="1" align="center">
<tr>
<td>Apple-iphone<input
type="radio" name="get"
value="Apple-iphone"/></td>
</tr>
<tr>
<td>Apple-ipod<input
type="radio" value="Apple-ipod" name="get"/></td>
</tr>
<tr>
<td>Apple-Notepad<input
type="radio" value="Apple-Notepad"
name="get"/></td>
</tr>
<tr>
<td
rowspan="2"> <input type="submit" /></td>
</tr>
</table>
</form>
</body>
</html>
Filename-productbean.jsp
<html>
<title>
Process
bean.
</title>
<body>
<jsp:useBean
id="p1" class="def21.Product" />
<jsp:setProperty
name="p1" property="*"
/>
<%--<jsp:getProperty
name="p1" property="name" />--%>
Name:
${p1.name}
<br>
<%--
<jsp:setProperty name="p1" property="des" />
<jsp:getProperty name="p1"
property="des" /> --%>
Description:
${p1.des}
<br>
<%--
<jsp:setProperty name="p1" property="price" />
<jsp:getProperty name="p1"
property="price" /> --%>
Price:
${p1.price}
</body>
</html>
Filename-removeattribute.jsp
<html>
Remove attribute
<%
session.removeAttribute("p1");
%>
</html>
No comments:
Post a Comment