中易网

问题:找不到错误: 找不到符号 double result=areaA.doubleValue();找不到areaA

答案:2  悬赏:30  
解决时间 2021-03-22 22:09
<%@page contentType="text/html" pageEncoding="GB2312"%>
<%@page import="java.text.*"%>
<%@taglib tagdir="/WEB-INF/tags" prefix="sx"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<FORM action="" method=get name=form>
<table>
<tr>
<td>请输入边长a</td>
<td><INPUT type="text" name="a"></td>
</tr>
<tr>
<td>请输入边长b</td>
<td><INPUT type="text" name="b"></td>
</tr>
<tr>
<td>请输入边长c</td>
<td><INPUT type="text" name="c"></td>
</tr>
</table>
<INPUT type="submit" value="提交" name=submit>
</form>
<%
String a=request.getParameter("a");
String b=request.getParameter("b");
String c=request.getParameter("c");
if(a==null||b==null||c==null){
a="0";
b="0";
c="0";
}
else if(a.length()>0&&b.length()>0&&c.length()>0){ %>
<sx:get_triangle_area sideA="<%= a%>"sideB="<%= b%>"sideC="<%= c%>"/>
<% }%>

<%
NumberFormat s=NumberFormat.getInstance();
s.setMaximumFractionDigits(6);//小数点后面6位
double result=areaA.doubleValue();
String str=s.format(result);
out.println(str);
%>
</body>
</html>
TAG:<%@tag description="put the tag description here" pageEncoding="GB2312"%>

<%-- The list of normal or fragment attributes can be specified here: --%>
<%@attribute name="sideC" required="true"%>
<%@attribute name="sideA" required="true"%>
<%@attribute name="sideB" required="true"%>
<%@variable name-given="areaA" variable-class="java.lang.Double" scope="AT_END" %>

<%-- any content can be specified here e.g.: --%>
<%
double a=Double.parseDouble(sideA);
double b=Double.parseDouble(sideB);
double c=Double.parseDouble(sideC);
if(a+b>c&&a+c>b&&b+c>a)
{
double p=(a+b+c)/2.0;
double result=Math.sqrt(p*(p-a)*(p-b)*(p-c));
jspContext.setAttribute("areaA",new Double(result));
}
else
jspContext.setAttribute("areaA", new Double(-1));
%>

variable指令为何无法将可以将Tag文件中的对象返回给调用该Tag文件的JSP页面如:areaA对象
最佳答案
void main()
{
double a,b,c,p,area;
printf("请输入3条边长:");
scanf("%d%d%d",&a,&b,&c); //逗号分隔,然后是 a b c如果为int类型%d,如果是double,则为 %lf
p=(a+b+c)/2;
area=sqrt(p*(p-a)*(p-b)*(p-c));
printf("area=%f/n",area);
}
全部回答
我。。知。。道 加。。我。。私。。聊
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
坐长途汽车从泰州去南京火车站,从哪坐车
十二洛一钼钒弯头机械性能及化学成分
最近收到封邮件,说是多次有人对我QQ进行申诉
脖子扭到筋怎么办
人家的一句祝福的短信是不是结束语?我没有回
华北电力大学有网球场吗?
周公解梦梦见戴手表
罐装液化气12公斤公现在多少钱啊
刚学会开车,下午要去提新车,开车的时候有什
有趣的ppt演讲主题哪个好
广前糖业发展有限公司前进中学怎么去啊,我要
买二手槽钢到哪里去买,大家推荐一下?
一张1.5米的普通木床多少钱能买到?
请问淘宝自定义模板添加轮播 950*450 图片在P
请帮忙找一些穿越到古代之后又穿越回来的小说
推荐资讯
三星s7自拍左右颠倒怎么设置
鹤岗会计证
纸箱厂招聘印刷机长、分纸师傅,打钉 中山市
实木门的选材与家装风格要怎么搭配呢?
军军.朋朋和奇奇三个好朋友的年龄是三个连续
中国通信建设北京工程局天津分公司怎么样?
欧莱雅的新颖性.先进性和独特性
毕业后要到人才交流中心去报到?
中国到底需要多少艘055级万吨大驱
怎么下载微信6.26版本
主驱动程序:vga.dll 版本是5.01.2600.0000
我爱人是北京人,我是外地户口,没有工作没有
手机登qq时,显示手机磁盘不足,清理后重新登
刺客的套装怎么选啊?