主题:[讨论]请大家帮我看看这个错误!!
运行完以后就下面的错误了。。。我看错误都是数学符号的错误。。不知道是什么原因,请大家帮帮我,谢了。。。。
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 32 in the jsp file: /lx.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\Tomcat 5.0\work\Catalina\localhost\lx\org\apache\jsp\lx_jsp.java:82: ??? > ????? java.lang.String,java.lang.String
if(a+b>c&&a+c>b&&b+c>a)
^
An error occurred at line: 32 in the jsp file: /lx.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\lx\org\apache\jsp\lx_jsp.java:82: ??? > ????? java.lang.String,java.lang.String
if(a+b>c&&a+c>b&&b+c>a)
^
An error occurred at line: 32 in the jsp file: /lx.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\lx\org\apache\jsp\lx_jsp.java:82: ??? > ????? java.lang.String,java.lang.String
if(a+b>c&&a+c>b&&b+c>a)
^
An error occurred at line: 32 in the jsp file: /lx.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\lx\org\apache\jsp\lx_jsp.java:84: ??? / ????? java.lang.String,double
double p=(a+b+c)/2.0;
^
An error occurred at line: 32 in the jsp file: /lx.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\lx\org\apache\jsp\lx_jsp.java:85: ??? - ????? double,java.lang.String
double mianji=Math.sqrt(p*(p-a)*(p-b)*(p-c));
^
An error occurred at line: 32 in the jsp file: /lx.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\lx\org\apache\jsp\lx_jsp.java:85: ??? - ????? double,java.lang.String
double mianji=Math.sqrt(p*(p-a)*(p-b)*(p-c));
^
An error occurred at line: 32 in the jsp file: /lx.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\lx\org\apache\jsp\lx_jsp.java:85: ??? - ????? double,java.lang.String
double mianji=Math.sqrt(p*(p-a)*(p-b)*(p-c));
^
7 ??
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:127)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
这是我写的代码:
<%@ page contentType="text/html;charset=GB2312"%>
<body>
<!--HTML注释-->
<form action="" method=post name=form>
边长a
<input type=text name=a>
边长b
<input type=text name=b>
边长c
<input type=text name=c><br>
<input type=submit name=submit value=送出>
</form>
<%--JSP注释--%>
<%
String a=request.getParameter("a");
String b=request.getParameter("b");
String c=request.getParameter("c");
double aa=0,bb=0,cc=0;
%>
<%
if( a==null)
{
a="0";
b="0";
c="0";
}
%>
<%
try{
aa=Double.valueOf(a).doubleValue();
bb=Double.valueOf(b).doubleValue();
cc=Double.valueOf(c).doubleValue();
if(a+b>c&&a+c>b&&b+c>a)
{
double p=(a+b+c)/2.0;
double mianji=Math.sqrt(p*(p-a)*(p-b)*(p-c));
out.print("面积:"+mianji);
}
else
{
out.print("不能成为三角型");
}
}catch(Exception e){}
%>
</body>
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 32 in the jsp file: /lx.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\Tomcat 5.0\work\Catalina\localhost\lx\org\apache\jsp\lx_jsp.java:82: ??? > ????? java.lang.String,java.lang.String
if(a+b>c&&a+c>b&&b+c>a)
^
An error occurred at line: 32 in the jsp file: /lx.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\lx\org\apache\jsp\lx_jsp.java:82: ??? > ????? java.lang.String,java.lang.String
if(a+b>c&&a+c>b&&b+c>a)
^
An error occurred at line: 32 in the jsp file: /lx.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\lx\org\apache\jsp\lx_jsp.java:82: ??? > ????? java.lang.String,java.lang.String
if(a+b>c&&a+c>b&&b+c>a)
^
An error occurred at line: 32 in the jsp file: /lx.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\lx\org\apache\jsp\lx_jsp.java:84: ??? / ????? java.lang.String,double
double p=(a+b+c)/2.0;
^
An error occurred at line: 32 in the jsp file: /lx.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\lx\org\apache\jsp\lx_jsp.java:85: ??? - ????? double,java.lang.String
double mianji=Math.sqrt(p*(p-a)*(p-b)*(p-c));
^
An error occurred at line: 32 in the jsp file: /lx.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\lx\org\apache\jsp\lx_jsp.java:85: ??? - ????? double,java.lang.String
double mianji=Math.sqrt(p*(p-a)*(p-b)*(p-c));
^
An error occurred at line: 32 in the jsp file: /lx.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\lx\org\apache\jsp\lx_jsp.java:85: ??? - ????? double,java.lang.String
double mianji=Math.sqrt(p*(p-a)*(p-b)*(p-c));
^
7 ??
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:127)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
这是我写的代码:
<%@ page contentType="text/html;charset=GB2312"%>
<body>
<!--HTML注释-->
<form action="" method=post name=form>
边长a
<input type=text name=a>
边长b
<input type=text name=b>
边长c
<input type=text name=c><br>
<input type=submit name=submit value=送出>
</form>
<%--JSP注释--%>
<%
String a=request.getParameter("a");
String b=request.getParameter("b");
String c=request.getParameter("c");
double aa=0,bb=0,cc=0;
%>
<%
if( a==null)
{
a="0";
b="0";
c="0";
}
%>
<%
try{
aa=Double.valueOf(a).doubleValue();
bb=Double.valueOf(b).doubleValue();
cc=Double.valueOf(c).doubleValue();
if(a+b>c&&a+c>b&&b+c>a)
{
double p=(a+b+c)/2.0;
double mianji=Math.sqrt(p*(p-a)*(p-b)*(p-c));
out.print("面积:"+mianji);
}
else
{
out.print("不能成为三角型");
}
}catch(Exception e){}
%>
</body>