jsp:setProperty和jsp:getProperty動作到底怎么用

jsp:setProperty和jsp:getProperty動作:
馬克- to-win:馬克 java社區(qū):防盜版實名手機尾號: 73203。
jsp:useBean動作獲得Bean實例之后,要設置Bean的屬性可以通過jsp:setProperty動作進行。讀取Bean屬性可以通過使用jsp:getProperty動作。



例 4.2.1
<html>
<head>
</head>
<body>
<form action="jsp1.jsp" method="POST">
count<input  type="text" name="count"/><br />
Email:<input  type="text" name="email"/><br />
age:<input  type="text" name="age"/>
<input  type="submit" value="submit"/>
</form>
</body>
</html>




<jsp:useBean id="count1" class="com.MyBean"/>
<jsp:setProperty name="count1" property="count" />
Count1:
<jsp:getProperty name="count1" property="count"/>



<jsp:setProperty name="count1" property="count" /> 會被轉化成如下語句,就是從request當中找到count這個參數(shù),賦給count1的count這個屬性。
      JspRuntimeLibrary.introspecthelper(_jspx_page_context.findAttribute("count1"), "count", request.getParameter("count"), request, "count", false);