${}没有数据

  • ${}没有数据
    我是这样写的
    private double m_dA=0;
    private double m_dB=0;
    private double m_dResult=0;
    public double getA() {
        return this.m_dA;
    }
    public double getB() {
        return this.m_dB;
    }
    public double getResult() {
        return this.m_dResult;
    }
    <form>
    <tr>
    <td>${m_dA} </td>
    <td>+</td>
    <td>${m_dB }</td>
    <td>=</td>
    <td>${m_dResult }</td>
    </tr>
    </form>

分析原因

用${}:
1,访问Bean属性如:${user.uname}等价于<% User user=(User)request.getAttribute("user");out.print(user.getUname());%>
2,获取请求参数,如:
${param.username}等价于request.getParamter("username");

修改后有数据的代码

    This is my JSP page. <br>
    <form>
    <tr>
    <td>${a} </td>
    <td>+</td>
    <td>${b}</td>
    <td>=</td>
    <td>${result }</td>
    </tr>
    </form>
    private double a;
    private double b;
    private double result;
    public double getA() {
        return this.a;
    }
    public double getB() {
        return this.b;
    }
    public double getResult() {
        return this.result;
    }

你可能感兴趣的:(bug)