首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

<s:bean>

2012-09-06 
s:beanpublic class DegreeConverter {private float celciusprivate float fahrenheitpublic float g

<s:bean>

public class DegreeConverter {    private float celcius;    private float fahrenheit;    public float getCelcius() {        return (fahrenheit - 32)*5/9;    }    public void setCelcius(float celcius) {        this.celcius = celcius;    }    public float getFahrenheit() {        return celcius * 9 / 5 + 32;    }    public void setFahrenheit(float fahrenheit) {        this.fahrenheit = fahrenheit;    }}

?HTML页面:

<s:bean name="app06a.DegreeConverter" id="converter">        <s:param name="fahrenheit" value="212"/></s:bean>212&deg;F=<s:property value="#converter.celcius"/>&deg;C
?

热点排行