隨筆 - 64  文章 - 9  trackbacks - 0
          <2025年7月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          常用鏈接

          留言簿(6)

          我參與的團(tuán)隊(duì)

          隨筆分類(lèi)(88)

          隨筆檔案(92)

          文章分類(lèi)(142)

          文章檔案(182)

          天基成員

          學(xué)習(xí)園

          我的海角

          搜索

          •  

          積分與排名

          • 積分 - 184349
          • 排名 - 317

          最新評(píng)論

          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("藍(lán)色");%>
          <jsp:setProperty  name="ball"  property= "price" 
          value= "528" />
          <jsp:setProperty  name="ball"  property= "weight" 
          value= "1.02" />
          <jsp:setProperty  name="ball"  property= "factory" 
          value= "美國(guó)" />
          籃球的顏色為:
          <jsp:getProperty  name= "ball"  property= "color" /><br>
          價(jià)格為:
          <jsp:getProperty  name= "ball"  property= "price" /><br>
          重量為:
          <jsp:getProperty  name= "ball"  property= "weight" /><br>
          產(chǎn)地為:
          <jsp:getProperty  name= "ball"  property= "factory" /><br>
          <a href="ball2.jsp">點(diǎn)我看看</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>
          價(jià)格為:
          <jsp:getProperty  name= "ball"  property= "price" /><br>
          重量為:
          <jsp:getProperty  name= "ball"  property= "weight" /><br>
          產(chǎn)地為:
          <jsp:getProperty  name= "ball"  property= "factory" /><br>
          <a href="ball3.jsp">再點(diǎn)我看看</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>
          價(jià)格為:
          <jsp:getProperty  name= "ball"  property= "price" /><br>
          重量為:
          <jsp:getProperty  name= "ball"  property= "weight" /><br>
          產(chǎn)地為:
          <jsp:getProperty  name= "ball"  property= "factory" /><br>
          這是ball3.jsp的頁(yè)面
          <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>
          價(jià)格為:
          <%=ball.getPrice()%><br>
          重量為:
          <%=ball.getWeight()%><br>
          產(chǎn)地為:
          <%=ball.getFactory()%><br>
          這是ball4.jsp的頁(yè)面

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


           


           


           


          posted on 2009-05-05 21:04 鵬凌 閱讀(153) 評(píng)論(0)  編輯  收藏 所屬分類(lèi): Java --j2ee
          主站蜘蛛池模板: 汪清县| 婺源县| 偃师市| 项城市| 宁波市| 巴东县| 渑池县| 昌宁县| 湟源县| 额敏县| 黄浦区| 湘潭县| 科技| 岫岩| 阿克苏市| 南投县| 读书| 沐川县| 彭山县| 建德市| 山阴县| 兴和县| 丹凤县| 郸城县| 青冈县| 马龙县| 仙居县| 福贡县| 宁乡县| 峨边| 太仆寺旗| 岗巴县| 江源县| 文登市| 和政县| 嵊泗县| 峡江县| 上犹县| 泉州市| 南漳县| 小金县|