<CENTER> <TABLE BORDER=5 BGCOLOR="#EF8429"> <TR><TH CLASS="TITLE"> What's New at JspNews.com</TABLE> </CENTER> <P> Here is a summary of our four most recent news stories: <OL> <LI><jsp:include page="news/Item1.html" flush="true"/> <LI><jsp:include page="news/Item2.html" flush="true"/> <LI><jsp:include page="news/Item3.html" flush="true"/> <LI><jsp:include page="news/Item4.html" flush="true"/> </OL> </BODY> </HTML>
jsp:setProperty動作有下面四個屬性: 屬性 說明 name name屬性是必需的。它表示要設(shè)置屬性的是哪個Bean。 property property屬性是必需的。它表示要設(shè)置哪個屬性。有一個特殊用法:如果property的值是“*”,表示所有名字和Bean屬性名字匹配的請求參數(shù)都將被傳遞給相應的屬性set方法。 value value屬性是可選的。該屬性用來指定Bean屬性的值。字符串數(shù)據(jù)會在目標類中通過標準的valueOf方法自動轉(zhuǎn)換成數(shù)字、boolean、Boolean、byte、Byte、char、Character。例如,boolean和Boolean類型的屬性值(比如“true”)通過Boolean.valueOf轉(zhuǎn)換,int和Integer類型的屬性值(比如“42”)通過Integer.valueOf轉(zhuǎn)換。 value和param不能同時使用,但可以使用其中任意一個。