国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JSP > 正文

關(guān)于JSP中JavaBean的setProperty屬性

2019-11-17 04:09:53
字體:
供稿:網(wǎng)友

1.包:

package PaintBrush;

/**
 *
 * @author lucifer
 */
public class PaintBrush {
     PRivate String curcolor = "red";
     public String getColor(){
          return curcolor;
     }
     public void setColor(String color){
          curcolor = color;
     }
}

 


2.jsp代碼:

<%--
    Document   : TestSetPro
    Created on : 2009-10-3, 15:02:50
    Author     : lucifer
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "


<jsp:useBean id="brush" class="PaintBrush.PaintBrush"/>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
         Original Color:
         <jsp:getProperty name="brush" property="color"/>
         <br>
         Changed Color:
         <jsp:setProperty name="brush" property="color" value="blue"/>
         <jsp:getProperty name="brush" property="color"/>
    </body>
</html>

 


3.輸出:

Original Color: red
Changed Color: blue


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 龙游县| 丰顺县| 钦州市| 鹿邑县| 济源市| 杭州市| 五指山市| 芦溪县| 柘城县| 龙陵县| 高雄县| 阿城市| 屏南县| 疏附县| 池州市| 大同县| 大兴区| 柯坪县| 开封县| 耿马| 鄂州市| 个旧市| 望江县| 隆昌县| 阿尔山市| 基隆市| 普陀区| 崇明县| 灌云县| 门源| 凤山县| 光山县| 教育| 兴义市| 潮安县| 黑山县| 万安县| 丹江口市| 沈阳市| 郎溪县| 扶沟县|