随笔 - 64  文章 - 9  trackbacks - 0
<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用链接

留言簿(6)

我参与的团队

随笔分类(88)

随笔档案(92)

文章分类(142)

文章档案(182)

天基成员

学习园

我的海角

搜索

  •  

积分与排名

  • 积分 - 178692
  • 排名 - 320

最新评论

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 鹏凌 阅读(135) 评论(0)  编辑  收藏 所属分类: Java --j2ee

只有注册用户登录后才能发表评论。


网站导航: