隨筆 - 64  文章 - 9  trackbacks - 0
          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(6)

          我參與的團隊

          隨筆分類(88)

          隨筆檔案(92)

          文章分類(142)

          文章檔案(182)

          天基成員

          學習園

          我的海角

          搜索

          •  

          積分與排名

          • 積分 - 183418
          • 排名 - 319

          最新評論

          WEB-INF-----classes---Ball.java----com(Ball.class)

          ball.java

          package com;
          public class Ball{
            private String color;
            private float price;
            private float weight;
            private String factory;/*制造商*/

          public void setColor(String c){
            this.color=c;
            }
          public String getColor(){
           return this.color;
           }
          public void setPrice(float p){
           this.price = p;
          }
          public float getPrice(){
           return this.price;
           }
          public void setWeight(float w){
           this.weight=w;
           }
          public float getWeight(){
           return this.weight;
           }
          public void setFactory(String f){
           this.factory=f;
           }
          public String getFactory(){
           return this.factory;
           }
          }



          ball1.jsp

          <%@ page contentType="text/html;Charset=gbk"%>
          <html>
          <body>
          <center>
          <font size="20">
          <jsp:useBean  id= "ball" class="com.Ball" scope= "session"/>
          <%ball.setColor("藍色");%>
          <jsp:setProperty  name="ball"  property= "price" 
          value= "528" />
          <jsp:setProperty  name="ball"  property= "weight" 
          value= "1.02" />
          <jsp:setProperty  name="ball"  property= "factory" 
          value= "美國" />
          籃球的顏色為:
          <jsp:getProperty  name= "ball"  property= "color" /><br>
          價格為:
          <jsp:getProperty  name= "ball"  property= "price" /><br>
          重量為:
          <jsp:getProperty  name= "ball"  property= "weight" /><br>
          產地為:
          <jsp:getProperty  name= "ball"  property= "factory" /><br>
          <a href="ball2.jsp">點我看看</a>
          </font>
          </body>
          </html>


          ball2.jsp

          <%@ page contentType="text/html;Charset=gbk"%>
          <html>
          <body>
          <center>
          <font size="20">
          <jsp:useBean  id= "ball" class="com.Ball" scope= "session"/>
          籃球的顏色為:
          <%=ball.getColor()%><br>
          價格為:
          <jsp:getProperty  name= "ball"  property= "price" /><br>
          重量為:
          <jsp:getProperty  name= "ball"  property= "weight" /><br>
          產地為:
          <jsp:getProperty  name= "ball"  property= "factory" /><br>
          <a href="ball3.jsp">再點我看看</a>
          </font>
          </body>
          </html>

          ball3.jsp

          <%@ page contentType="text/html;Charset=gbk"%>
          <html>
          <body>
          <center>
          <font size="20">
          <jsp:useBean  id= "ball" class="com.Ball" scope= "session"/>
          籃球的顏色為:
          <jsp:getProperty  name= "ball"  property= "color" /><br>
          價格為:
          <jsp:getProperty  name= "ball"  property= "price" /><br>
          重量為:
          <jsp:getProperty  name= "ball"  property= "weight" /><br>
          產地為:
          <jsp:getProperty  name= "ball"  property= "factory" /><br>
          這是ball3.jsp的頁面
          <a href="ball4.jsp">換種方法看一下</a>
          </font>
          </body>
          </html>


           

          ball4.jsp

          <%@ page contentType="text/html;Charset=gbk"%>
          <html>
          <body>
          <center>
          <font size="20">
          <jsp:useBean  id= "ball" class="com.Ball" scope= "session"/>
          籃球的顏色為:
          <%=ball.getColor()%>
          <br>
          價格為:
          <%=ball.getPrice()%><br>
          重量為:
          <%=ball.getWeight()%><br>
          產地為:
          <%=ball.getFactory()%><br>
          這是ball4.jsp的頁面

          </font>
          </body>
          </html>


           


           


           


          posted on 2009-05-05 21:04 鵬凌 閱讀(149) 評論(0)  編輯  收藏 所屬分類: Java --j2ee
          主站蜘蛛池模板: 灵丘县| 麻城市| 乐亭县| 买车| 镇巴县| 宁陵县| 长武县| 福清市| 阳山县| 浪卡子县| 沁水县| 荥经县| 霍城县| 荣昌县| 静宁县| 湟源县| 柞水县| 湘西| 台中县| 武威市| 涪陵区| 上虞市| 鄂尔多斯市| 北海市| 将乐县| 鲜城| 宣武区| 荔浦县| 深州市| 芒康县| 正镶白旗| 兰坪| 多伦县| 清镇市| 保定市| 诸城市| 梁河县| 班戈县| 台南市| 基隆市| 达尔|